Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable social logins #153

Closed
glena opened this issue Mar 16, 2016 · 0 comments
Closed

Disable social logins #153

glena opened this issue Mar 16, 2016 · 0 comments

Comments

@glena
Copy link
Contributor

glena commented Mar 16, 2016

function (user, context, callback) {

  user.app_metadata = user.app_metadata || {};

  if (context.stats.loginsCount === 1 && user.identities[0].isSocial) {

    user.app_metadata.is_singup = true; 

    auth0.users.updateAppMetadata(user.user_id, user.app_metadata)
      .then(function(){
        return callback('Signup disabled');
      })
      .catch(function(err){
        callback(err);
      });

    return;
  } 

  if (user.app_metadata.is_singup) {
    return callback('Signup disabled');
  }

  callback(null, user, context);
}
@glena glena closed this as completed Aug 16, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant