Failed Google-oauth authentication

I have been using Google-oauth2 all this while without any problems. When I try to log in now, I am getting a failed login error. The error message I see in the logs is uninformative and says: Cannot read property ‘then’ of undefined

How can I fix this, Auth0?

I have the same error on a custom db connector. Started to happen 10 minutes ago for apparently no reason.

Did someone push a faulty revision ?

We have the same issue… seems to be even broader. No auth.signin gets accepted.

So it doesn’t seem to be connector specific as we’re using their provided user DB.
Perhaps the error is related to one of the Rules (which we haven’t changed recently)

You are absolutely right. I turned off all the rules and I am able to log in successfully. But if any one rule is on, I will get the login error.

same. this is comming from auth0-authorization-extension for me. disabling the rule helps

same. this is comming from auth0-authorization-extension for me. disabling the rule helps

We are seeing this issue, caused by a call to

auth0.users.updateAppMetadata(user.user_id, user.app_metadata)

In a rule added by the Auth0 Authorization extension

Same error here:

{ error: "access_denied" errorDescription: "Cannot read property 'then' of undefined" state: "state string" } 

It looks like disabling custom rules fixes the issue. But it’s weird it started happening all of the sudden.

Is anyone able to raise this as a support ticket?
We’re on the free tier but I assume that’s why everyone else is posting here too.

It seems to be the function call to auth0.users.updateAppMetadata as @kristian mentioned. We’re using the Auth-authz extension.

In our case it seemed to work to change the persistUserData function of the rule to the below, essentially skipping the auth0.users.updateAppMetadata bit and calling the cb function directly.

    // Store authorization data in the user profile so we can query it later.
    var persistUserData = function(user, groups, roles, permissions, cb) {
      user.app_metadata = user.app_metadata || {};
      user.app_metadata.authorization = {
        groups: groups,
        roles: roles,
        permissions: permissions
      };
      // auth0.users.updateAppMetadata(user.user_id, user.app_metadata)
      // .then(function() {
      //   cb();
      // })
      // .catch(function(err){
      //   cb(err);
      // });
      cb();
    };

Logins still work and the Auth groups seem to get assigned correctly. Would be great to know from Auth0 if this function call is now unnecessary?

We’re having the same issue with Facebook and Google auth

That workaround works for me too.
Thanks! Hopefully Auth0 rollback whatever they did soon.

Workaround works for me too.

SAME ERROR HERE

Cannot read property then of undefined.

username-password connection works fine, but google-oauth2 is failing.

This is pretty urgent - it has taken our production site down

Hi,
This was caused by a problematic change in our Rules engine. The issue was already identified and solved.

Apologies for the inconveniences.

This will only append the metadata to the user object being returned after a successful login, but won’t update the user metadata stored in Auth0. If you call the API afterwards to read the user profile, the metadata won’t be there.

I am running into the same issue.

I am running into the same issue.

Same error here:

{ error: "access_denied" errorDescription: "Cannot read property 'then' of undefined" state: "state string" } 

It looks like disabling custom rules fixes the issue. But it’s weird it started happening all of the sudden.