The logout endpoint terminates the user’s session in two steps: it forwards the currentDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/BladimirGS/judicial-backend/llms.txt
Use this file to discover all available pages before exploring further.
refreshToken cookie to the external auth service’s revocation endpoint (/api/AuthJWT/Revoke), then unconditionally clears the refreshToken cookie on the client. Even if the external revocation call fails — for example, because the auth service is temporarily unavailable — the local cookie is still cleared and the backend considers the session closed.
Endpoint
POST /api/auth/logout
| Property | Value |
|---|---|
| Auth required | No — uses the refreshToken httpOnly cookie |
| Request body | None |
| Content-Type | Not required |
Request
No JSON body is needed. The endpoint reads theCookie request header to forward the session to the external auth service. If no cookie is present, the revocation step is skipped entirely and the response is still 200 OK.
Response — 200 OK
The response confirms the session has been closed. Regardless of whether the external revocation succeeded or failed, therefreshToken cookie is cleared in the Set-Cookie header.
Always
"success" on a 200 response.Human-readable confirmation:
"Sesión cerrada".Always
null for this endpoint.Set-Cookie header
The server clears the cookie by setting it to an expired value:refreshToken cookie is no longer present in the client’s cookie store and cannot be used to call /refresh.
Error Responses
This endpoint has no client-visible error responses. The backend always returns200 OK.
If the external revocation call fails — for example because the auth service is temporarily down — the controller catches the error internally, logs a warning, and continues. The refreshToken cookie is cleared regardless. From the client’s perspective, logout always succeeds.
Because external revocation errors are caught inside a
try/catch in the controller, a 503 from the external auth service is never forwarded to the client. The cookie is always cleared and the response is always 200 OK. Any previously issued access_token remains valid until its exp claim expires — keep access_token lifetimes short if immediate invalidation is required.Example
Request
-b cookies.txt flag sends the stored refreshToken cookie so the backend can forward it to the external revocation endpoint. The -c cookies.txt flag allows curl to persist the cleared cookie from the response.