feat: clear reset tokens on successful login

This commit is contained in:
Julian Lam
2021-06-14 11:50:32 -04:00
parent c7006ec6b4
commit f9728aff2c
2 changed files with 8 additions and 0 deletions

View File

@@ -556,4 +556,11 @@ describe('authentication', () => {
},
], done);
});
it('should clear all reset tokens upon successful login', async () => {
const code = await user.reset.generate(regularUid);
await loginUserPromisified('regular', 'regularpwd');
const valid = await user.reset.validate(code);
assert.strictEqual(valid, false);
});
});