How can I make a field required in credential auth? #618
-
Your question What are you trying to do Feedback
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The authorize option in the Credentials provider can be used to return null or return a rejected Promise. You can also reject it with an The following are all valid ways to reject a sign in attempt from the Credentials provider:
This is documented here https://next-auth.js.org/providers/credentials |
Beta Was this translation helpful? Give feedback.
The authorize option in the Credentials provider can be used to return null or return a rejected Promise.
You can also reject it with an
Error
object or by returning aurl
as a string.The following are all valid ways to reject a sign in attempt from the Credentials provider:
Promise.resolve(null)
Promise.reject(new Error('Invalid Credentials'))
Promise.reject('/signin?error=invalid_credentials')
This is documented here https://next-auth.js.org/providers/credentials