mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
fix: ensure cache invalidation when verifying OTP
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
It is possible this broke after redis caching was employed because it broke the expectation that assignments to attributes on cached objects would remain for future accesses on said objects. This has not been confirmed as the cause.
This commit is contained in:
@@ -87,7 +87,7 @@ module.exports = eggspress('/auth/configure-2fa/:action', {
|
||||
// this should never be used to verify the user's 2FA code
|
||||
// for authentication purposes.
|
||||
actions.test = async () => {
|
||||
const user = req.user;
|
||||
const user = await get_user({ id: req.user.id, force: true });
|
||||
const svc_otp = x.get('services').get('otp');
|
||||
const code = req.body.code;
|
||||
const ok = svc_otp.verify(user.username, user.otp_secret, code);
|
||||
|
||||
Reference in New Issue
Block a user