/api/auth/verify
Returns the userId and tenantId that the auth middleware decoded from the JWT on the current request. This endpoint is registered under /api/auth which is a public route prefix — it does not independently verify the token. In practice it is most useful when called after passing through the global auth middleware (i.e., as an internal utility rather than a standalone verification endpoint).
The
/api/auth prefix is registered before the global authMiddleware in index.ts, so this endpoint does not independently validate the token. It returns the userId and tenantId values already attached to the request by middleware from a prior step.Request headers
Bearer token in the format
Bearer <token>. Required for the middleware to attach user identity to the request.Response
UUID of the authenticated user decoded from the token.
UUID of the authenticated user’s tenant decoded from the token.
Errors
| Status | Error message | Description |
|---|---|---|
401 | Missing or invalid authorization header | The Authorization header is absent or does not start with Bearer . |
401 | Invalid token | The token is malformed, expired, or signed with an incorrect secret. |
Example
curl