retry setPassword on first nonce failure. fixes #664
This commit is contained in:
parent
b96d2949f7
commit
81f3347981
2 changed files with 40 additions and 30 deletions
|
@ -24,12 +24,12 @@ module.exports = async function(req, res) {
|
|||
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
|
||||
return res.sendStatus(401);
|
||||
}
|
||||
const nonce = crypto.randomBytes(16).toString('base64');
|
||||
storage.setField(id, 'nonce', nonce);
|
||||
res.set('WWW-Authenticate', `send-v1 ${nonce}`);
|
||||
} catch (e) {
|
||||
res.sendStatus(404);
|
||||
return res.sendStatus(404);
|
||||
}
|
||||
const nonce = crypto.randomBytes(16).toString('base64');
|
||||
storage.setField(id, 'nonce', nonce);
|
||||
res.set('WWW-Authenticate', `send-v1 ${nonce}`);
|
||||
storage.setField(id, 'auth', req.body.auth);
|
||||
storage.setField(id, 'pwd', 1);
|
||||
res.sendStatus(200);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue