Skip to content

Commit

Permalink
[WIP] Logs for testing Google Auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Mason committed Mar 7, 2024
1 parent fc809ff commit 4418608
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/api/authGoogle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ const oAuth2Client = new OAuth2Client(
// exchanges Auth Code for Tokens
async function getTokens(code) {
const { tokens } = await oAuth2Client.getToken(code);

// eslint-disable-next-line no-console
console.log("TOKENS:", tokens);
return tokens;
}

export default async function handler(req, res) {
try {
// eslint-disable-next-line no-console
console.log("CODE:", req.body.code);
const { id_token: idToken } = await getTokens(req.body.code);
res.status(200).json({ idToken });
} catch (err) {
Expand Down

0 comments on commit 4418608

Please sign in to comment.