Skip to content

Commit

Permalink
add email to response oAuth google
Browse files Browse the repository at this point in the history
  • Loading branch information
mk1020 committed Nov 5, 2021
1 parent 161f1e8 commit 04a6071
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/components/auth/oAuth.scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const oAuthGoogleScheme: FastifySchema = {
}
},
userId: {type: 'number'},
email: {type: 'string'},
}
},
500: {
Expand Down
2 changes: 1 addition & 1 deletion app/components/auth/oAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const oAuth = async (server: FastifyInstance) => {
return reply
.header('Content-Type', 'application/json; charset=utf-8')
.status(201)
.send(JSON.stringify({userId, token}));
.send(JSON.stringify({userId, token, email: payload.email}));
} catch (e) {
return reply.status(500).send(e);
}
Expand Down

0 comments on commit 04a6071

Please sign in to comment.