Skip to content

Function: mountGate()

mountGate(opts, _addRoute, addMiddleware): void

Register the login routes and the gating middleware on the app’s Express instance. Called from AuthGatePlugin with the router AppKit hands injectRoutes, plus this.context.addMiddleware for the global gate.

addRoute/addMiddleware are used (via the passed callbacks) because the login routes live at an ABSOLUTE path (/api/email/auth/*, the client’s contract), not under the plugin’s /api/authGate base.

GateOptions

(method, path, handler) => void

(path, handler) => void

void