-1
When Google One Tap is used on a website and if the user has signed in to more than one Google account before loading the web page, the user is presented with a consent and sign-in dialog including information about his/her Google session(s) (email address, profile picture, etc.), with all emails he has been signed in even if the user visits the website for the first time.
Let's say the user has 3 different google account signed in, how can we filter those emails based on personal and working email.
Is there a way to show only working emails in that sign-in dialog.
We are using this package: https://www.npmjs.com/package/react-google-login
import React from 'react';
import ReactDOM from 'react-dom';
import GoogleLogin from 'react-google-login';
// or
import { GoogleLogin } from 'react-google-login';
const responseGoogle = (response) => {
console.log(response);
}
ReactDOM.render(
<GoogleLogin
clientId="658977310896-
knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com"
buttonText="Login"
onSuccess={responseGoogle}
onFailure={responseGoogle}
cookiePolicy={'single_host_origin'}
/>,
document.getElementById('googleButton')
);
CodePudding user response:
I am also having this issue, doesn't look like there is a way around it
CodePudding user response:
The Readme
page of the npm package you have linked to tells us that the onSuccess
callback returns a GoogleUser
object, with access to all its properties using the methods associated with it, as mentioned in https://developers.google.com/identity/sign-in/web/reference#users
One of those methods is GoogleUser.getHostedDomain() which is what you might be looking for.
Always read the documentation.