Create a new session
POST/api/v1/session
Authenticates a user and creates a new session. Returns a 400 error when username/password sign-in is disabled with NEXT_PUBLIC_CREDENTIALS_ENABLED=false.
Request
Responses
- 200
- 400
- 401
- 429
Session created successfully.
Bad request error.
The credentials are correct but the user's email address is not verified. A verification code is emailed to the user; send it back in `code` with the same credentials.
Too many wrong passwords for this account. The first 15 go through right away, then each attempt has to come at least 25 seconds after the last one. A correct password, a password reset or a password change starts the count over. The web login form and the password prompts for changing the email or password and for deleting the account share the same limit.
Response Headers
Retry-After integer
Seconds to wait before the next attempt.