Skip to main content

SpaAuthApi

The refresh and sign-out API for a SPA client, where JS holds the refresh token directly.

Refreshing resolves to a RefreshResult: rotated carries the next refresh token to persist, and noSession means the session is gone.

Properties​

PropertyType
refreshSession(refreshToken) => Promise< | { kind: "rotated"; tokens: { accessToken: string; refreshToken: string; refreshTokenExpiresAt: number; userId: string; }; } | { kind: "noSession"; }>
signOut(refreshToken) => Promise<void>