Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ export const post = async (request, response) => {

if (decodedData) {
const jsonData = JSON.parse(decodedData);
//CoCo sending message to indicate the resource was created, does not need processing
if ('ResourceCreated' === jsonData.notificationType) {
throw new CustomError(
202,
`Incoming message is about subscription resource creation. Skip handling the message.`
);
}

customerId = jsonData.customer.id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export const authMiddlewareOptions = {
clientId: readConfiguration().clientId,
clientSecret: readConfiguration().clientSecret,
},
scopes: [readConfiguration().scope ? readConfiguration().scope : 'default'],
scopes: readConfiguration().scope ? [readConfiguration().scope] : undefined,
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export const createAuthMiddlewareOptions = () => ({
clientId: readConfiguration().clientId,
clientSecret: readConfiguration().clientSecret,
},
scopes: [readConfiguration().scope ? readConfiguration().scope : 'default'],
scopes: readConfiguration().scope ? [readConfiguration().scope] : undefined,
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export const authMiddlewareOptions = {
clientId: readConfiguration().clientId,
clientSecret: readConfiguration().clientSecret,
},
scopes: [readConfiguration().scope ? readConfiguration().scope : 'default'],
scopes: readConfiguration().scope ? [readConfiguration().scope] : undefined,
};
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export const post = async (request: Request, response: Response) => {

if (decodedData) {
const jsonData = JSON.parse(decodedData);
//CoCo sending message to indicate the resource was created, does not need processing
if ('ResourceCreated' === jsonData.notificationType) {
throw new CustomError(
202,
`Incoming message is about subscription resource creation. Skip handling the message.`
);
}

customerId = jsonData.customer.id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ export const createAuthMiddlewareOptions: () => AuthMiddlewareOptions = () => ({
clientId: readConfiguration().clientId,
clientSecret: readConfiguration().clientSecret,
},
scopes: [
(readConfiguration().scope
? readConfiguration().scope
: 'default') as string,
],
scopes: readConfiguration().scope
? [readConfiguration().scope as string]
: undefined,
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ export const authMiddlewareOptions: AuthMiddlewareOptions = {
clientId: readConfiguration().clientId,
clientSecret: readConfiguration().clientSecret,
},
scopes: [
readConfiguration().scope
? (readConfiguration().scope as string)
: 'default',
],
scopes: readConfiguration().scope
? [readConfiguration().scope as string]
: undefined,
};
Loading