We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b05baf8 commit d3b6a63Copy full SHA for d3b6a63
index.js
@@ -63,7 +63,10 @@ module.exports = function basicAuth(callback, realm) {
63
var authorization = req.headers.authorization;
64
65
if (req.user) return next();
66
- if (!authorization) return unauthorized(res, realm);
+ if (!authorization) {
67
+ unauthorized(res, realm);
68
+ return;
69
+ }
70
71
var parts = authorization.split(' ');
72
@@ -81,7 +84,10 @@ module.exports = function basicAuth(callback, realm) {
81
84
// async
82
85
if (callback.length >= 3) {
83
86
callback(user, pass, function(err, user){
- if (err || !user) return unauthorized(res, realm);
87
+ if (err || !user) {
88
89
90
91
req.user = req.remoteUser = user;
92
next();
93
});
0 commit comments