https://supertokens.com/ logo
check reset password token validity
s

samuel-qosenergy

03/17/2023, 11:01 AM
Hello #644849840475602944 Is there a way to check that the reset-password token is still valid (and the remaining time before it expires) ?
r

rp

03/17/2023, 11:45 AM
hey @samuel-qosenergy there is no built in way to do that unfortunately. What you can do is that you can override the recipe function that generates the reset password token and save the has of that token in your db against the timestamp. Then to know the time remaining of the token, you can query your own db with the token hash and get the time it was created, based on which you can get the time left before it expires, given that the token's lifetime is statically configured in the supertokens core.
s

samuel-qosenergy

03/17/2023, 12:56 PM
OK, thanks We will do a custom patch to get this kind of info