Skip to content

Commit

Permalink
included email in jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
Aydan Pirani committed Aug 19, 2024
1 parent 5234bd0 commit 41675e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/auth/auth-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function createGoogleStrategy(device: string) {

Database.ROLES.findOneAndUpdate(
{ userId: userId },
{ userId, displayName, email, roles },
{ displayName, email, roles },
{ upsert: true }
)
.then(() => cb(null, profile))
Expand All @@ -40,7 +40,9 @@ export async function getJwtPayloadFromDatabase(userId: string) {
"userId",
"displayName",
"roles",
"email",
]);

if (!payload) {
throw new Error("NoUserFound");
}
Expand Down

0 comments on commit 41675e8

Please sign in to comment.