Skip to content

Function: wantsLoginPage()

wantsLoginPage(req): boolean

Whether a denied request is a top-level BROWSER NAVIGATION that should be answered with the hosted login page rather than a 401.

An app fronted by the gate (via gatePaths) may serve its own HTML from an ungated path while its privileged surface (/ws, /api) is gated. A browser navigating to it would otherwise load the app shell and only see the gated request fail, with no way to sign in. Serving the login page on the navigation itself puts sign-in in front of the app. Applies only to GET requests that accept HTML and are not asking for the login API or an asset.

IncomingMessage

boolean