Authentication routes for login, signup, OAuth, session management, and MCP tokens.
Register a new user with email and password.
Body:
{ "name": "string", "email": "string", "password": "string" }
Response: User info. Sets authentication cookies.
Side effects: Creates personal drive, default AI settings, logs event.
Authenticate with email and password.
Body:
{ "email": "string", "password": "string" }
Response: User info. Sets authentication cookies.
Security: Rate limited by IP and email.
Log out and invalidate session.
Side effects: Deletes refresh token, clears cookies, logs event.
Get the current authenticated user's profile.
Response:
{
"id": "string",
"name": "string",
"email": "string",
"role": "user | admin",
"provider": "email | google | both",
"currentAiProvider": "string",
"currentAiModel": "string"
}
Refresh the session using a one-time refresh token. Implements token rotation.
Security: Rate limited. Detects token reuse (potential theft) and invalidates all sessions.
Generate a CSRF token for the current session.
Response:
{ "csrfToken": "string" }
Initiate Google OAuth flow. POST accepts an optional returnUrl.
Response: Redirects to Google authorization URL.
Handle Google OAuth callback. Creates or links user account, sets authentication cookies.
Create a new MCP token for API access.
Body:
{ "name": "string" }
Response:
{
"id": "string",
"name": "string",
"token": "mcp_...",
"createdAt": "string"
}
The token value is only returned once at creation.
List all MCP tokens for the current user (without token values).
Response:
[{
"id": "string",
"name": "string",
"lastUsed": "string | null",
"createdAt": "string",
"revokedAt": "string | null"
}]
Revoke a specific MCP token. The user must own the token.
Search docs, blog posts, and more.