Skip to content

Commit

Permalink
Use Google business mails by default for login (#18462)
Browse files Browse the repository at this point in the history
  • Loading branch information
timroes authored Oct 26, 2022
1 parent f90ffb0 commit a25dc47
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export class GoogleAuthService {
}

async loginWithOAuth(provider: OAuthProviders) {
await signInWithPopup(this.auth, provider === "github" ? new GithubAuthProvider() : new GoogleAuthProvider());
// Instantiate the appropriate auth provider. For Google we're specifying the `hd` parameter, to only show
// Google accounts in the selector that are linked to a business (GSuite) account.
const authProvider =
provider === "github" ? new GithubAuthProvider() : new GoogleAuthProvider().setCustomParameters({ hd: "*" });
await signInWithPopup(this.auth, authProvider);
}

async login(email: string, password: string): Promise<UserCredential> {
Expand Down

0 comments on commit a25dc47

Please sign in to comment.