Skip to main content

auth-service

Registration, login, sessions, OAuth, account management, and the admin panel's own auth. Details: Auth & Permissions.

/api/v1/auth

MethodPathWhat it does
POST/registerCreate an account
POST/loginPassword login → access + refresh token
POST/refreshRotate a refresh token; reuse revokes the whole account's sessions
POST/logoutRevoke the current refresh token
GET/meCurrent account
POST/account/passwordChange password
PATCH/accountUpdate profile fields

/api/v1/auth/oauth

MethodPathWhat it does
GET/versionBuild/version probe
GET/providersWhich providers are enabled
GET/:provider/startBegin the provider redirect
GET/:provider/callbackProvider returns here; issues a one-time code
POST/exchangeTrade the one-time code for a session

/api/v1/admin

Requires GlobalRole.ADMIN, checked by database lookup on every request (not a token claim — a demotion has to take effect immediately).

MethodPathWhat it does
GET/statusWhether any admin exists yet
GET/usersList accounts
PATCH/users/:idChange role / disable / enable
DELETE/users/:idDelete an account
GET/auditRead AdminAudit
GET/oauthRead provider configs
PUT/oauth/:providerSet a provider's credentials

The first administrator is never created through this API — pnpm admin:create runs where the database already is, the one place that proves the operator owns the deployment.