Skip to content

Logout

Logout the authenticated user or store by invalidating their token.

Endpoint

POST /v1/accounts/logout/

Authentication

Required

Request Body

No body required. The token is extracted from the Authorization header.

Response

Success (200 OK)

{
  "message": "Successfully logged out"
}

Error Responses

Unauthorized (401)

{
  "error": "Missing token on header!"
}

Example Request

curl -X POST "https://api.luxmart.site/v1/accounts/logout/" \
  -H "Authorization: Token your_access_token"

Notes

  • The token is deleted from the database
  • After logout, the token cannot be used for authentication
  • User must login again to get a new token