Velaron.AI

DocsPlatform

Sign-in and sessions

Sign in with an email code or Google. Your account is the Privy user behind that login; there is no password and nothing to install.

Two ways in, one kind of account#

The sign-in dialog is run by Privy. Pick an email code or Google. Either way, Privy's id for you is your Velaron.AI account: credits, keys, purchases and conversations are all kept against it. Signing in with the same email by either method lands in the same account.

What happens after the dialog#

  1. The browser sends Privy's short-lived access token to POST /api/auth/privy.
  2. The server checks the token against Privy's public keys for this app, reads your email and name from Privy, and records them so the dashboard can show who is signed in.
  3. You get a session: a signed cookie that names a row in the server's database. It lasts seven days. Privy's own login lasts longer, so a return visit after that just refreshes the cookie without asking you anything.

Signing out#

Signing out closes the session row and the Privy login, so the cookie is dead at once even if it was copied. Because the cookie only names a row, a server-side revoke ends a session before the cookie expires. POST /api/auth/logout?everywhere=1 closes every session of the account, in every browser.

Endpoints#

RouteWhat it does
POST /api/auth/privy{ token } → { userId, email, name }, and the session cookie.
GET /api/auth/me{ userId, email, name } of the signed-in person, or nulls.
POST /api/auth/logoutEnds this session; ?everywhere=1 ends them all.