Skip to content

Commit

Permalink
Merge pull request #172 from AI-READI/auth-claims-error-handling
Browse files Browse the repository at this point in the history
added email regex to email claim
  • Loading branch information
kirenotneb authored Dec 20, 2024
2 parents 1cf0d6e + 4c3e3aa commit 315f0f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/routes/login.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ function getEmail(tokenResponse: AuthenticationResult): string {
email = tokenResponse.account.username;
} else if (
"email" in tokenResponse.idTokenClaims &&
typeof tokenResponse.idTokenClaims.email === "string"
typeof tokenResponse.idTokenClaims.email === "string" &&
emailRegex.test(tokenResponse.idTokenClaims.email)
) {
email = tokenResponse.idTokenClaims.email;
} else if ("emails" in tokenResponse.idTokenClaims) {
Expand Down

0 comments on commit 315f0f5

Please sign in to comment.