FrameworkAuthAdapter
Defined in: packages/react/src/config/useFrameworkComponents.ts:144
App-provided sign-in/out actions for AdminTopNav’s control.
FrameworkComponents.auth
Properties
Section titled “Properties”signInHref
Section titled “signInHref”signInHref: (
redirectTo) =>string
Defined in: packages/react/src/config/useFrameworkComponents.ts:153
Builds the sign-in URL for a signed-out visitor, given the current admin URL to
return to after signing in (e.g. appended as a redirectTo query param, matching
the convention the project’s own sign-in-gate middleware already uses).
Parameters
Section titled “Parameters”redirectTo
Section titled “redirectTo”string
The current admin URL (path + query), to return to after sign-in.
Returns
Section titled “Returns”string
The sign-in route’s URL, e.g. /auth/sign-in?redirectTo=%2Fadmin%2Fposts.
signOut
Section titled “signOut”signOut: () =>
Promise<void>
Defined in: packages/react/src/config/useFrameworkComponents.ts:170
Signs the current session out AND triggers whatever full, server-aware refresh the
framework needs (Next.js: signOut() then router.refresh()) so the admin panel’s
own server-resolved auth state (VexAuthProvider, seeded by NextAdminPage) and any
route guard re-evaluate against the now-signed-out session on return — landing on the
sign-in page if anonymous admin access isn’t configured, or the admin panel’s own
anonymous view if it is, exactly like a fresh unauthenticated request would.
AdminTopNav only calls this once and shows a pending state until it settles — the
adapter owns the whole sequence, not just the Better Auth call.
Returns
Section titled “Returns”Promise<void>
A promise that resolves once the ENTIRE sign-out sequence (not just the
auth-client call) completes — AdminTopNav’s own pending state matches its
lifetime. Should resolve even on failure (matching SessionButton.tsx’s own “a
stale client cache after a failed sign-out is worse than a redundant refresh”
reasoning) rather than rejecting and leaving the control stuck pending.