Human users
Email/password
The default login method. The clientPOSTs credentials to /api/auth/login, which validates them and sets an HTTP-only session cookie. All subsequent requests include the cookie automatically.
Social login
When configured, users can sign in via Google, GitHub, or Discord:- Client calls
POST /api/auth/socialwith the chosen provider - User is redirected to the provider’s OAuth page
- Provider redirects back to
/api/auth/callback/* - The server exchanges the code and sets a session cookie
Session storage
Sessions are stored in HTTP-only cookies. The default TTL is 30 days. Cookies are tied to the server’s configured domain and are not accessible via JavaScript.Auth endpoints
The login and register endpoints have a stricter rate limit (10 req/min, burst 5) than the global limit. See Rate Limiting for details.
Bot authentication
Bots use token-based authentication via theAuthorization header instead of session cookies.
Token format: botID.secret (a dot-separated ID and secret)
Header:
POST /api/bots. The token is only shown once — store it securely. If lost or compromised, regenerate it via POST /api/bots/{botID}/regenerate-token. The old token is invalidated immediately on regeneration.
Bots can access the same resource endpoints as human users (servers, channels, messages, reactions) but cannot access bot management endpoints or WebSocket connections intended for human clients.
Mobile App
The MeepaChat mobile app is available on iOS via TestFlight. It connects to your self-hosted instance — just enter your server URL when signing in.WebSocket authentication
The WebSocket endpoint (/api/ws) requires authentication. The server reads the session cookie via SessionCookieToHeader middleware, which promotes the cookie to an Authorization header before the auth check runs. No separate token is needed for WebSocket connections from a browser.