Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/google' into google
Browse files Browse the repository at this point in the history
  • Loading branch information
hye1ee committed Dec 2, 2024
2 parents 7a201dc + edc390e commit 8835884
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/api/src/auth/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const gauthenticate = async (code: string): Promise<string | null> => {
"postmessage",
);
const token = await logininfo.getToken(code);
const username = Token.parse(
jwt.decode(token.tokens.id_token!),
).email.split("@")[0];
const mail = Token.parse(jwt.decode(token.tokens.id_token!)).email;
const username =
mail.split("@")[1] === "sparcs.org" ? mail.split("@")[0] : null;
return username;
} catch {
return null;
Expand Down

0 comments on commit 8835884

Please sign in to comment.