From ef245b70df482ff470877459fcb28e1f490fe42d Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Sat, 17 Aug 2024 17:20:31 -0400 Subject: [PATCH] fix: do primary read of user after setting email_confirmed --- src/backend/src/routers/confirm-email.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/src/routers/confirm-email.js b/src/backend/src/routers/confirm-email.js index 839ebb2e..bf013c54 100644 --- a/src/backend/src/routers/confirm-email.js +++ b/src/backend/src/routers/confirm-email.js @@ -70,7 +70,8 @@ router.post('/confirm-email', auth, express.json(), async (req, res, next)=>{ "UPDATE `user` SET `email_confirmed` = 1, `requires_email_confirmation` = 0 WHERE id = ? LIMIT 1", [req.user.id], ); - invalidate_cached_user(req.user); + const svc_getUser = req.services.get('get-user'); + await svc_getUser.get_user({ id: req.user.id, force: true }); } // Build response object