Я пытаюсь заставить работать новый вход в Google одним нажатием, следуя этому руководству:
https://developers.google.com/identity/one-tap/web/get-started
Когда я звоню:
const hintPromise = googleyolo.hint({
supportedAuthMethods: [
"https://accounts.google.com"
],
supportedIdTokenProviders: [
// Google can provide ID tokens -- signed assertions of a user's
// identity -- which you can use to create more streamlined sign-in
// and sign-up experiences.
{
uri: "https://accounts.google.com",
clientId: "YOUR_GOOGLE_CLIENT_ID"
}
]
});
Я получаю ответ в обратном вызове обещания без ошибок. Но idToken пуст...
hintPromise.then((credential) => {
if (credential.idToken) { // <= THIS IS ALWAYS FALSE!!!
// Send the token to your auth backend.
loginWithGoogleIdToken(credential.idToken);
}
}, (error) => { console.log(error); });
объект credential
выглядит так:
{
authDomain: "http://localhost:3000",
authMethod: "https://accounts.google.com",
displayName: "testName",
id: "[email protected]"
}
Кому-нибудь удалось заставить это работать?