Skip to content

Commit

Permalink
Logout ms only when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mawandm committed Jun 17, 2024
1 parent 26eed90 commit 205b255
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions nesis/frontend/client/src/SessionContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@ export function useSignOut(client, config) {

async function logoutMicrosoft(config) {
try {
const msalInstance = new PublicClientApplication({
auth: {
clientId: config?.auth?.OAUTH_AZURE_CLIENT_ID,
authority: config?.auth?.OAUTH_AZURE_AUTHORITY,
redirectUri: config?.auth?.OAUTH_AZURE_REDIRECTURI,
postLogoutRedirectUri: config?.auth?.OAUTH_AZURE_REDIRECTURI,
},
});
await msalInstance.initialize();
await msalInstance.logoutRedirect();
if (config?.auth?.NESIS_OAUTH_AZURE_ENABLED) {
const msalInstance = new PublicClientApplication({
auth: {
clientId: config?.auth?.OAUTH_AZURE_CLIENT_ID,
authority: config?.auth?.OAUTH_AZURE_AUTHORITY,
redirectUri: config?.auth?.OAUTH_AZURE_REDIRECTURI,
postLogoutRedirectUri: config?.auth?.OAUTH_AZURE_REDIRECTURI,
},
});
await msalInstance.initialize();
await msalInstance.logoutRedirect();
}
} catch (e) {
/* ignored */
}
Expand Down

0 comments on commit 205b255

Please sign in to comment.