
Any object returned will be saved in `user` property of the JWT You can pass any HTML attribute to the tag through the object. domain, username, password, 2FA token, etc. You can specify which fields should be submitted, by adding keys to the `credentials` object. `credentials` is used to generate a form on the sign in page. The name to display on the sign in form (e.g.

Import CredentialsProvider from "next-auth/providers/credentials" The Credentials provider's authorize() method also provides the request object as the second parameter (see example below).

If you throw an Error, the user will be sent to the error page with the error message as a query parameter. If you return null then an error will be displayed advising the user to check their details. If you return an object it will be persisted to the JSON Web Token and the user will be signed in, unless a custom signIn() callback is configured that subsequently rejects it.
