MCPcopy Index your code
hub / github.com/LionC/express-basic-auth / IAsyncAuthorizerOptions

Interface IAsyncAuthorizerOptions

express-basic-auth.d.ts:126–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 }
125
126 interface IAsyncAuthorizerOptions extends IBaseOptions {
127 /**
128 * Set it to true to use a asynchronous authorizer.
129 */
130 authorizeAsync: true
131
132 /**
133 * You can pass an asynchronous authorizer. It will be passed a callback as the third parameter, which is
134 * expected to be called by standard node convention with an error and a boolean to indicate if the credentials
135 * have been approved or not.
136 *
137 * Example:
138 * app.use(basicAuth({ authorizer, authorizeAsync: true }));
139 *
140 * function authorizer(username, password, authorize) {
141 * if(username.startsWith('A') && password.startsWith('secret'))
142 * return authorize(null, true)
143 *
144 * return authorize(null, false)
145 * }
146 */
147 authorizer: AsyncAuthorizer
148 }
149}
150
151export = expressBasicAuth

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…