Skip to content

Commit

Permalink
Merge pull request #99 from eclipse-mnestix/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
GailMelanie authored Feb 6, 2025
2 parents fa2def0 + 773d28f commit cee81b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/authentication/authConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ export const authOptions: AuthOptions = {
if (account.id_token) {
const decodedToken = jwt.decode(account.id_token);
if (decodedToken) {
if (account.provider === 'azure-ad') {
if (account.provider === 'azure-ad' && account.access_token) {
// Entra ID stores the username only in the access_token
const decodedAccessToken = jwt.decode(account.access_token);
// @ts-expect-error name exits
userName = decodedToken.name;
userName = decodedAccessToken.name;
}
// @ts-expect-error role exits
roles = decodedToken.roles;
Expand Down

0 comments on commit cee81b6

Please sign in to comment.