diff --git a/src/modules/Monedero/persona/google.strategy.ts b/src/modules/Monedero/persona/google.strategy.ts index 21c0825..3166f43 100644 --- a/src/modules/Monedero/persona/google.strategy.ts +++ b/src/modules/Monedero/persona/google.strategy.ts @@ -32,6 +32,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { authorizationParams() { return { prompt: 'select_account', + hd: 'pcpuma.acatlan.unam.mx', }; } @@ -45,6 +46,13 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { try { const email = profile.emails?.[0]?.value || ''; + if (!email.endsWith('@pcpuma.acatlan.unam.mx')) { + return done( + new Error('El correo no pertenece al dominio permitido'), + false, + ); + } + const user = await this.personaService.validateOrCreateGoogleUser({ email, });