Ana içeriğe geç

Log in (SPA cookie session)

POST 

/api/login

Authenticates the GLOBAL account (its password is the sole credential — no tenant slug required) and resolves the account's active memberships. Requires the CSRF cookie from /sanctum/csrf-cookie.

  • Exactly one active membership → logs in immediately as that tenant's user (needs_tenant_selection: false, user populated). A session cookie is set.
  • More than one active membership → does NOT log in (needs_tenant_selection: true, user: null); the client must call POST /api/session/select-tenant with a chosen tenant_id.

Request​

Responses​

Either authenticated (single membership; session cookie set) or awaiting tenant selection (multiple memberships).