MCPcopy Create free account
hub / github.com/LionC/express-basic-auth / staticUsersAuthorizer

Function staticUsersAuthorizer

index.js:40–46  ·  view source on GitHub ↗
(username, password)

Source from the content-addressed store, hash-verified

38 assert(typeof authorizer == 'function', 'Expected a function for the basic auth authorizer, found ' + typeof authorizer + ' instead')
39
40 function staticUsersAuthorizer(username, password) {
41 for(var i in users)
42 if(safeCompare(username, i) & safeCompare(password, users[i]))
43 return true
44
45 return false
46 }
47
48 return function authMiddleware(req, res, next) {
49 var authentication = auth(req)

Callers

nothing calls this directly

Calls 1

safeCompareFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…