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

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:
KernelDeimos
2026-02-06 23:37:39 -05:00
committed by Eric Dubé
parent ac8456f8d3
commit 020a64dbbd
@@ -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);