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 authored and blnkt committed Mar 7, 2024
1 parent 2e0566e commit bdc3c77
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 bdc3c77

Please sign in to comment.