Internal_protectedRouterProvider: () => AuthenticationProvider | undefinedInternal accessor returning the currently-configured authentication provider. Used by transports outside the HTTP middleware chain (e.g. the WebSocket upgrade path) so they can inherit the router's auth without snapshotting it.
Readonly[ProtectedRouterBrand]: trueBrand marker used by other helpers to detect a ProtectedRouter without coupling
to its concrete type. Always true on ProtectedRouter instances.
Sets the authentication provider used to gate every route registered on this router. The provider is consulted on each request, so calling this after routes are already registered updates authentication for all of them.
Creates a mountable Router instance whose routes registered via verb methods (
get/post/put/patch/delete/head/options/all/connect/trace) orroute()are all gated by an authentication provider. Middleware registered viarouter.use(...)is intentionally NOT auto-gated; the gate is route-scoped to keep mount-order behavior predictable for downstream callers.Behaves like the exported
Router()factory (including optional route-parameter rewriting), with the addition ofsetAuthenticationProvider.