Hi, it's me with another newbie question. How can ...
# help
u
Hi, it's me with another newbie question. How can i capture the URL adress when user clicks "forgot password" link? Because yeah, it redirects users to
https://<id>.supabase.co/auth/v1/verify?token=<TOKEN>&type=recovery&redirect_to=http://localhost:3000/ForgotPassword/Reset
which redirects them to
http://localhost:3000/ForgotPassword/Reset#access_token=<ACCESS_TOKEN>&expires_in=3600&refresh_token=<REFRESH_TOKEN>&token_type=bearer&type=recovery
but as soon as they're there the link becomes just
http://localhost:3000/ForgotPassword/Reset#
so my code only gets the
ForgotPassword/Reset#
and not the entire thing i have
http://localhost:3000/ForgotPassword/Reset
in my Additional Redirect URLs too
n
Hello @4Lajf! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
a
One alternative is to listen to the password recovery event and then navigate to where u want https://supabase.com/docs/reference/javascript/auth-onauthstatechange
n
4Lajf (2022-03-27)
u
Great, but I encountered another issue. When I use
resetPasswordForEmail()
then the event on
onAuthStateChange
is
SIGNED_IN
not
PASSWORD_RECOVERY
a
I got the password recovery event
I think both fires?
dont see any problem anyway
u
Ok, thanks a lot
n
Thread was archived by @4Lajf. Anyone can send a message to unarchive it.