Fixed no Basic Auth being absent
This commit is contained in:
parent
58344d94cd
commit
e61e8ebd9e
1 changed files with 3 additions and 1 deletions
|
@ -169,7 +169,9 @@ const checkAccess = async (req:any, res:any, next: Function) => {
|
|||
if (await aCallFirst0('authnFailure', {req, res})) return;
|
||||
if (await aCallFirst0('authFailure', {req, res, next})) return;
|
||||
// No plugin handled the authentication failure. Fall back to basic authentication.
|
||||
//res.header('WWW-Authenticate', 'Basic realm="Protected Area"');
|
||||
if (!requireAdmin) {
|
||||
res.header('WWW-Authenticate', 'Basic realm="Protected Area"');
|
||||
}
|
||||
// Delay the error response for 1s to slow down brute force attacks.
|
||||
await new Promise((resolve) => setTimeout(resolve, exports.authnFailureDelayMs));
|
||||
res.status(401).send('Authentication Required');
|
||||
|
|
Loading…
Reference in a new issue