From aae6cb8704ed73888522c69037f35c3e65d070e3 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Fri, 24 Oct 2025 19:48:53 -0600 Subject: [PATCH] added authorization hd --- src/modules/Monedero/persona/google.strategy.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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, });