Endpoints
User
Login
-
Endpoint:
{URI_PREFIX}/user/login/ -
Method:
POST -
Description: Login a user.
-
Request:
Field Required Length Description emailYes <= 150 Email of the user. passwordYes None Password of the user. codeConditional =6 TOTP code. It is required if user has TOTP enabled. -
Response:
Field Type Description last_sessiondjango_axor_auth.users.users_sessions.serializers.UserSessionSerializerornullLast session information. last_token_sessiondjango_axor_auth.users.users_app_tokens.serializers.UserAppTokenSerializerornullLast token session information. userdjango_axor_auth.users.serializers.UserSerializerUser information. session?{"id": string, "key": string}Session information. Only available if app-token based authentication is used. -
Errors:
-
TOTP token is required but is not provided.
{ "detail": "TOTP token is required.", "status": "401", "title": "2FA code is required", "code": "TOTPRequired" } -
Invalid TOTP token.
{ "detail": "Provided TOTP code or backup code is incorrect. Please try again.", "status": "401", "title": "2FA code is incorrect", "code": "TOTPIncorrect" }
-
Register
-
Endpoint:
{URI_PREFIX}/user/register/ -
Method:
POST -
Description: Register a user.
-
Request:
Field Required Length Description emailYes <= 150 Email of the user. passwordYes Any Password of the user. first_nameYes <= 150 First name of the user. last_nameYes <= 150 Last name of the user. -
Response:
Field Type Description last_sessionnullLast session information. last_token_sessionnullLast token session information. userdjango_axor_auth.users.serializers.UserSerializerUser information. session?{"id": string, "key": string}Session information. Only available if app-token based authentication is used.
Logout
- Endpoint:
{URI_PREFIX}/user/logout/ - Method:
POST - Description: Logout a user.
- Request: Empty.
Current User
- Endpoint:
{URI_PREFIX}/user/me/ - Method:
GET - Description: Get the current authenticated user.