From 29b9158a63840eceb26454fdddb0b5d6f6517342 Mon Sep 17 00:00:00 2001 From: Flavien David Date: Mon, 15 Jan 2024 18:41:11 +0100 Subject: [PATCH] Use Google Workspace --- front/pages/api/login.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/front/pages/api/login.ts b/front/pages/api/login.ts index cfce8f352902..2bebc87d88c6 100644 --- a/front/pages/api/login.ts +++ b/front/pages/api/login.ts @@ -27,9 +27,11 @@ const { DUST_INVITE_TOKEN_SECRET = "" } = process.env; async function createWorkspace(session: any) { const [, emailDomain] = session.user.email.split("@"); - // Use domain only when email is verified and non-disposable. + // Use domain only when email is verified on Google Workspace and non-disposable. + const isEmailVerified = + session.provider.provider !== "google" && session.user.email_verified; const verifiedDomain = - session.user.email_verified && !isDisposableEmailDomain(emailDomain) + isEmailVerified && !isDisposableEmailDomain(emailDomain) ? emailDomain : null;