Skip to Content
HomeLink Hub
Authentication

Sign out of the current session

POST
/api/v1/auth/signout

Access: Public. Sending a bearer token is optional and personalises the result.

Ends a session. The route has no auth middleware and is idempotent: it always answers 200, even with no body, an invalid token or an expired token. The user and session are taken from refreshToken in the body if it verifies, otherwise from an Authorization: Bearer <access token> header if one is sent.

With a valid refreshToken that matches the one stored on the account, the stored refresh token is removed and the session is deleted from the session list. With only a bearer access token, the session is removed from the list but the stored refresh token is left in place. The access token itself is not revoked and keeps working until it expires. session_id is accepted by validation but ignored. Push tokens are not touched: call DELETE /user/push-tokens to stop pushes to the device.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Request Body

application/json
  1. body
refreshToken?string

The session's refresh token. Recommended: without it the stored refresh token is not invalidated.

session_id?string

Accepted but not used by the handler.

Response Body

Always, whether or not a session was actually found and removed

application/json
  1. response
status*integer
success*boolean
message*string
data*unknown
Example Request
curl -X POST 'http://localhost:4000/api/v1/auth/signout' \  -H 'Content-Type: application/json' \  -d '{  "refreshToken": "eyJhbGciOiJIUzI1NiIs..."}'
Example Response
{  "status": 200,  "success": true,  "message": "Signed out successfully.",  "data": null}