Merge pull request #1134 from omnivore-app/fix/google-auth-aud

Google JWT Audience
This commit is contained in:
Satindar Dhillon
2022-08-24 21:30:34 -07:00
committed by GitHub

View File

@ -59,6 +59,7 @@ export const validateGoogleUser = async (
const iosClientId = env.google.auth.iosClientId
const webClientId = env.google.auth.clientId
const androidClientId = env.google.auth.androidClientId
const googleWebClient = new OAuth2Client(webClientId)
const googleIOSClient = new OAuth2Client(iosClientId)
@ -72,7 +73,7 @@ export async function decodeGoogleToken(
const loginTicket = await googleMobileClient.verifyIdToken({
idToken,
audience: isAndroid ? env.google.auth.androidClientId : iosClientId,
audience: [iosClientId, webClientId, androidClientId],
})
const email = loginTicket.getPayload()?.email