import type { AuthToken } from './token'; import type { NewUser } from '@stacksjs/orm'; /** * Register a user and open a full session for them. * * Returns the same triple `Auth.loginUsingId()` does. It used to return only * the access token, because it called `Auth.createToken()` — a wrapper that * mints a refresh token and an expiry and then throws both away. With * `config.auth.tokenExpiry` defaulting to one hour, that made every freshly * registered account unable to refresh: a client that correctly stores the pair * and exchanges it at `/auth/refresh` worked for everyone except the user who * had just signed up, who was logged out an hour into their first session * (stacksjs/stacks#2212). * * Additive, so `const { token } = await register(...)` is unaffected. */ export declare function register(credentials: NewUser): Promise; /** * What a successful registration hands back: a complete session, matching * `Auth.loginUsingId()`. * * Named rather than inlined on the signature so consumers can type the result, * and because pickier's unused-parameter analysis mis-reads a multi-line return * annotation and flags `credentials` as unused. */ export declare interface RegistrationResult { token: AuthToken refreshToken?: string expiresIn?: number }