Skip to Content
Documentation

Username

Sign-in with a username instead of an email address.

/sign-in/username

POST
/sign-in/username

Sign in with username

Request Body

application/json
  1. body
username*string

The username of the user

password*string

The password of the user

rememberMe?boolean

Remember the user session

callbackURL?string

URL to redirect to after sign in (also used as the redirect target for email verification when required)

Response Body

Success

application/json
  1. response
redirect*boolean

Whether the client should follow the Location header. True when callbackURL was provided.

token*string

Session token for the authenticated session

url?string

The callbackURL echoed back so the client can redirect.

user*
Example Request
curl -X POST 'https://auth.example.com/api/auth/sign-in/username' \  -H 'Content-Type: application/json' \  -d '{  "username": "string",  "password": "string"}'
Example Response
{  "redirect": true,  "token": "string",  "url": "string",  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false  }}

/is-username-available

POST
/is-username-available

Request Body

application/json
  1. body
username*string

The username to check

Response Body

Bad Request. Usually due to missing parameters, or invalid parameters.

application/json
  1. response
message*string
Example Request
curl -X POST 'https://auth.example.com/api/auth/is-username-available' \  -H 'Content-Type: application/json' \  -d '{  "username": "string"}'
Example Response
{  "message": "string"}