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

Function myAsyncAuthorizer

test.js:115–120  ·  view source on GitHub ↗
(username, password, cb)

Source from the content-addressed store, hash-verified

113
114//Same but asynchronous
115function myAsyncAuthorizer(username, password, cb) {
116 if(username.startsWith('A') && password.startsWith('secret'))
117 return cb(null, true)
118 else
119 return cb(null, false)
120}
121
122function myComparingAuthorizer(username, password) {
123 return basicAuth.safeCompare(username, 'Testeroni') & basicAuth.safeCompare(password, 'testsecret')

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…