Skip to main content
MeepaChat handles authentication via a sidecar service that manages user accounts, session cookies, and social login.

Human users

Email/password

The default login method. The client POSTs 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:
  1. Client calls POST /api/auth/social with the chosen provider
  2. User is redirected to the provider’s OAuth page
  3. Provider redirects back to /api/auth/callback/*
  4. The server exchanges the code and sets a session cookie
Which providers are available depends on server configuration. Query the auth config endpoint to find out:

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 the Authorization header instead of session cookies. Token format: botID.secret (a dot-separated ID and secret) Header:
Bot tokens are issued when a bot is created via 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.
Never commit bot tokens to source control or include them in client-side code. Treat them like passwords.

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.