Skip to content
Get started

Create

client.auth.token.create(TokenCreateParams { email, password } body, RequestOptionsoptions?): TokenCreateResponse { access, refresh }
POST/api/auth/token/

Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials.

ParametersExpand Collapse
body: TokenCreateParams { email, password }
email: string
minLength1
password: string
minLength1
ReturnsExpand Collapse
TokenCreateResponse { access, refresh }
access: string
refresh: string
Create
import OvermindLab from 'overmind-lab';

const client = new OvermindLab();

const token = await client.auth.token.create({ email: 'x', password: 'x' });

console.log(token.access);
{
  "access": "access",
  "refresh": "refresh"
}
Returns Examples
{
  "access": "access",
  "refresh": "refresh"
}