Skip to content

Commit

Permalink
Use Google Workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Jan 15, 2024
1 parent 7b7ecae commit 29b9158
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions front/pages/api/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 29b9158

Please sign in to comment.