Skip to content

Commit

Permalink
add logs to diagnose pizza issue
Browse files Browse the repository at this point in the history
  • Loading branch information
freemvmt committed Jul 18, 2024
1 parent d583e96 commit 3713f6d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions api.planx.uk/modules/auth/strategy/microsoft-oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ export const getMicrosoftClientConfig = (): ClientMetadata => {
if (typeof client_id !== "string") {
throw new Error("No MICROSOFT_CLIENT_ID in the environment");
}

// for troubleshooting on pizza
const apiRedirectUri = `${process.env.API_URL_EXT}/auth/microsoft/callback`;
console.log("Returning Microsoft client with redirect URI", apiRedirectUri);
const editorRedirectUri = process.env.EDITOR_URL_EXT!;
console.log("Returning Microsoft client with post-logout redirect URI", editorRedirectUri);

return {
client_id,
client_secret: process.env.MICROSOFT_CLIENT_SECRET!,
redirect_uris: [`${process.env.API_URL_EXT}/auth/microsoft/callback`],
post_logout_redirect_uris: [process.env.EDITOR_URL_EXT!],
redirect_uris: [apiRedirectUri],
post_logout_redirect_uris: [editorRedirectUri],
response_types: ["id_token"],
};
};
Expand Down

0 comments on commit 3713f6d

Please sign in to comment.