WebAuthCookieSession extension

Web-auth-cookie helpers on Session: decides whether a request wants cookie-based web auth and writes/clears the auth cookie accordingly.

on

Properties

isWebAuthCookieRequest bool

Available on Session, provided by the WebAuthCookieSession extension

Whether the request participates in cookie-based web auth transport (via the webAuthModeHeaderName header) and the server has a ServerpodConfig.authCookie configured.
no setter
webAuthBasePath String?

Available on Session, provided by the WebAuthCookieSession extension

The browser-visible base path the cookie-mode client declared via the webBasePathHeaderName header, or null when absent or malformed.
no setter

Methods

clearWebAuthCookie({String? refreshCookiePath}) → void

Available on Session, provided by the WebAuthCookieSession extension

Clears the auth cookie for cookie-mode requests (a no-op otherwise).
readWebAuthRefreshCookie() String?

Available on Session, provided by the WebAuthCookieSession extension

Reads the JWT refresh token from the refresh cookie for cookie-mode requests, or null when cookie mode is not active or the cookie is absent.
writeWebAuthCookie(String token, {int? maxAgeSeconds}) bool

Available on Session, provided by the WebAuthCookieSession extension

If isWebAuthCookieRequest, writes token as the auth cookie and returns true. Otherwise returns false and the caller should return the token in the response body as usual. maxAgeSeconds sets the cookie lifetime; omit it for a session cookie.
writeWebAuthRefreshCookie(String refreshToken, {int? maxAgeSeconds, String? path}) bool

Available on Session, provided by the WebAuthCookieSession extension

If isWebAuthCookieRequest, writes refreshToken as the JWT refresh cookie and returns true. Otherwise returns false and the caller should return the refresh token in the response body as usual.