Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nelrondon/backend-proyecto-estructuras/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/logout terminates the current session by overwriting the token cookie with an empty string and setting its expiry to the Unix epoch (new Date(0)). The browser immediately discards the cookie on receipt, so any future request to a protected route will be rejected by the authRequired middleware with a 401. Because there is no server-side session store, this is the only mechanism available to invalidate a token before its 7-day natural expiry.
Endpoint
Request Body
No request body is needed. The server ignores any payload sent with this request.Cookie Mechanism
The server calls:token to an empty string with an expiry date in the past, which causes the browser to immediately delete the cookie. Subsequent requests will have no token cookie to present to authRequired.
Example Request
Response
200 — Success
A confirmation string indicating the session has been cleared. Always
"Usuario deslogueado".This endpoint always returns 200, even if no valid
token cookie was present in the request. It is safe to call logout multiple times or from an already-unauthenticated state.