mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
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('authnFailure', {req, res})) return;
|
||||||
if (await aCallFirst0('authFailure', {req, res, next})) return;
|
if (await aCallFirst0('authFailure', {req, res, next})) return;
|
||||||
// No plugin handled the authentication failure. Fall back to basic authentication.
|
// 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.
|
// Delay the error response for 1s to slow down brute force attacks.
|
||||||
await new Promise((resolve) => setTimeout(resolve, exports.authnFailureDelayMs));
|
await new Promise((resolve) => setTimeout(resolve, exports.authnFailureDelayMs));
|
||||||
res.status(401).send('Authentication Required');
|
res.status(401).send('Authentication Required');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue