Matt
CCConvex Community
•Created by Matt on 3/24/2025 in #support-community
Convex Auth - reset password when logged in
I've set up convex auth with email verification and password reset using Resend. Everything is working great. I can reset the password as intended when a user is NOT logged in. I.e. the user has forgotten the password, they enter their email, they're emailed a code via Resend, they enter it together with a new password and it's updated correctly. However separately, I now have a modal within the app where a user should be able to update their password when they are already logged in.
The problem I'm having it that the reset flow seems to delete the session data, logging the user out. I ideally don't want this as this breaks the UI and throws an error as there are queries in the background that rerun and throw an error if there's no logged in user.
Is there a way round this? I feel like this is a common situation where a user would like to update their password whilst logged in?
I've alternatively looked at not using the signIn auth method with the reset flow, but instead trying to use a mutation to update the password but I note that you can't seem to patch the password as it isn't exposed
Thanks
8 replies