Я просто пытаюсь реализовать вход одним нажатием на наш веб-сайт (https://www.emagister.com). Все работало хорошо до вчерашнего дня, когда реализация начала давать сбой с "noCredentialsAvailable: учетные данные для текущего пользователя недоступны".
Я видел руководство по устранению неполадок, и все кажется правильным.
1.- домен занесен в белый список в консоли разработчика Google
2.- Я вошел в систему с помощью Googleучетная запись
3.- Smartlock включен
4.- Версия Chrome Версия 66.0.3359.170 (официальная сборка) (64 бита)
Код:
var Element_Login_AutologinGoogle = function (force) {
this.methods = {
supportedAuthMethods: [
"https://accounts.google.com"
],
supportedIdTokenProviders: [
{
uri: "https://accounts.google.com",
clientId: xxxx-xxxx.apps.googleusercontent.com
}
],
context: 'continue'
};
this.init(force);
};
Element_Login_AutologinGoogle.prototype.signup = function (googleyolo) {
var that = this,
hintPromise = googleyolo.hint(that.methods);
hintPromise.then((credential) => {
if (credential.idToken) {
// Send the token to your auth backend.
that.emagisterLogin(credential.idToken);
}
}, (error) => {
switch (error.type) {
case "userCanceled":
// The user closed the hint selector. Depending on the desired UX,
// request manual sign up or do nothing.
break;
case "noCredentialsAvailable":
// No hint available for the session. Depending on the desired UX,
// request manual sign up or do nothing.
break;
case "requestFailed":
// The request failed, most likely because of a timeout.
// You can retry another time if necessary.
break;
case "operationCanceled":
// The operation was programmatically canceled, do nothing.
break;
case "illegalConcurrentRequest":
// Another operation is pending, this one was aborted.
break;
case "initializationError":
// Failed to initialize. Refer to error.message for debugging.
break;
case "configurationError":
// Configuration error. Refer to error.message for debugging.
break;
default:
// Unknown error, do nothing.
}
});
Надеюсь, вы мне поможете.
Большое спасибо:)