Replies: 1 comment
-
You should take a look at the callbacks that you can set up in your To disable signup process, you may decide to just You can also limit it to certain users using something like this. Below example is using Twitter and a local array of Twitter user id's that are allowed to sign in. Here you can match anything, e.g only users already in db etc with your own logic. signIn: async (user, account, profile) => {
const allowedUsers = ["1", "2"] // twitter user id's
if (allowedUsers.includes(profile.id_str)) {
return Promise.resolve(true) // allow sign in
} else {
return Promise.reject('/?e=NotAllowed') // deny sign in, passing e=NotAllowed as query param.
// return Promise.resolve(false)
// return Promise.reject(new Error('error message')) // Redirect to error page
// return Promise.reject('/path/to/redirect') // Redirect to a URL
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an internal application that don't require user signup, but the user my be flagged with
status
=suspended
. How can I add some logic to the signin process, and how can I disable signup process?Beta Was this translation helpful? Give feedback.
All reactions