How to revoke all sessions after reset password from forget password link?

I don't find any way to revoke all logged in sessions of a user after reset password from forget password link. I see there is an method authClient.revokeSessions() to do this but it need an loggedin sesison.

Also i think about one other solution to login user using the email and newPassword but there is no way to get the email from the forget password link.

Althought i can add an extra searchparam in the link before sending but i am looking for better way.
Solution
this approach worked for me, i manually fetch the user email using the userId, then first login the user and then revokeOtherSesion using authClient.

Thanks
Was this page helpful?