1

I'm just trying to implement one tap login to our website (https://www.emagister.com). Everything worked well until yesterday that the implementation begun to fail with:

noCredentialsAvailable: No credential is available for the current user

I saw the troubleshooting guide and everything seems to be right.

  1. the domain is whitelisted in google console developer

  2. I'm signed in with a google account

  3. Smartlock is enabled​

  4. Chrome version Versión 66.0.3359.170 (Build oficial) (64 bits)

Code:

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.
            }
        });
pkamb
  • 33,281
  • 23
  • 160
  • 191
MrCester
  • 43
  • 9

0 Answers0