Authentication
The implemented API uses Better Auth signed session cookies, not Bearer API tokens. The dashboard client lives in apps/dashboard/src/lib/auth-client.ts; the worker handles Better Auth GET/POST requests under /api/auth/*.
Sign In and Sessions
Use the dashboard email/password login form. Enabled two-factor accounts continue through an authenticator or backup-code challenge before login completes. Protected custom routes validate the signed better-auth.session_token cookie (including secure/host-prefixed variants), its expiry, and its user. A raw Bearer token is not an alternative.
Use credentials: 'include' for cross-origin browser API requests. Worker CORS permits yoba.systems and its subdomains, plus explicit web/dashboard localhost and 127.0.0.1 origins in development. Better Auth separately checks trusted origins.
This is an example request, not a recorded response. Never copy session cookies into client code or commit credentials.
Authorization
- Platform admin/operator roles gate global user listing and audit reads; global mutations require platform admin.
- Organization listing/creation and catalog sync require platform
super_adminplus membership inorg_yobasystems. - Org member/admin helpers validate target-org membership and permit platform super-admin bypasses.
- Billing management requires owner/admin membership in the target org with no platform-role bypass.
- The custom members API blocks changing your own role and removing your own membership.
UI permissions derive from the authenticated user’s active organization membership. Platform roles remain separate, and server authorization is authoritative.
Password Reset and Invitations
Use Better Auth requestPasswordReset() and resetPassword(); the reset screen is /reset-password?token=…. Onboarding uses /accept-invitation?id=…, sign-in, and organization.acceptInvitation(). New recipients enter their invited email address, name, and password; the form creates the account, signs in, and submits authenticated acceptance. The public lookup intentionally omits recipient email, and server verification determines whether the account matches the invitation. Standard self-service organization creation is disabled.
There is no implemented /settings/api-tokens route, token-scope management, CLI token command, or /v1/auth/refresh endpoint in this repository. See Endpoints for the implemented paths.