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
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)
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?
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.