S
Supabase8mo ago
Tommy1

reset password with supabase and react native expo don't found

12 Replies
Tommy1
Tommy1OP8mo ago
Hello everyone, I'm having a problem with my app in the forgot password function, I'm doing that the user writes the email and the app sends a password reset email that starts him to a page to change it the problem is that he can't find the token that contains the email to change password I can't really solve it. Could someone help me please? Thanks in advance!! const handlePasswordReset = async () => { try { const redirectUrl = https://www.mysite.it/resetPass?email=${encodeURIComponent(email)}; console.log("Redirect URL:", redirectUrl); // Log per debug const { error } = await supabase.auth.resetPasswordForEmail(email, { redirectTo: redirectUrl, });
if (error) { Alert.alert('Errore', error.message); } else { Alert.alert('Successo', 'Controlla la tua email per reimpostare la password.'); } } catch (error) { console.error("Errore durante la richiesta di reset:", error); Alert.alert('Errore', 'Si è verificato un errore.'); } }; supabase conf: Site URL Configure the default redirect URL used when a redirect URL is not specified or doesn't match one from the allow list. This value is also exposed as a template variable in the email templates section. Wildcards cannot be used here. Site URL https://www.mysite.it/ Cancel Save Redirect URLs URLs that auth providers are permitted to redirect to post authentication. Wildcards are allowed, for example, https://*.domain.com Docs Add URL https://www.mysite.it/resetPass mysite://* Total URLs: 2
j4
j48mo ago
Are they receiving the email, or is an error happening after they click the link in the email?
Tommy1
Tommy1OP8mo ago
After clicking the link takes me to the Expo page of my site to change my password but I can't find the email or token because if I did it after the user has done the authentication the password reset should work but I'm doing it as a forgot password so he can't log in
j4
j48mo ago
Clickimg the link should be logging them in automatically. Are you doing the implicit or pkce flow?
Tommy1
Tommy1OP8mo ago
it does not connect sbito because I am doing that if you have forgotten the password it sends an email that contains the link to take it to the resetPass page and then when it is there it changes the password based on the email received via parameter only that this parameter never receives it
j4
j48mo ago
I just now saw the file. It's best to put only relevant code inside a set of triple backticks, that way it shows up in the post instead of someone having to download and open a file to see your code.
Tommy1
Tommy1OP8mo ago
I know I only apologize that I had the character limit
j4
j48mo ago
Can you paste a copy of the link from one of the emails?
j4
j48mo ago
So are both the token and email values not there when you check? I wouldn't expect the token value to show up, as that's already been handled by your supabase instance
Tommy1
Tommy1OP8mo ago
I tried to do a check and the email manages to get it through php script or with another language but if I use Expo I can't pass the parameter because on the phone it asks me if I want to open the Expo app and then the parameters are as if they were removed
j4
j48mo ago
I'm no help with that part, as I don't know expo and mobile development.

Did you find this page helpful?