diff --git a/api.planx.uk/modules/auth/strategy/microsoft-oidc.ts b/api.planx.uk/modules/auth/strategy/microsoft-oidc.ts index b30fab45e4..ab0322c4dd 100644 --- a/api.planx.uk/modules/auth/strategy/microsoft-oidc.ts +++ b/api.planx.uk/modules/auth/strategy/microsoft-oidc.ts @@ -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"], }; };