https://supabase.com/ logo
Join DiscordCommunities
Powered by
# javascript
  • t

    tandyman

    03/26/2022, 7:10 PM
    redirectTo is not working for password reset emails
  • t

    tandyman

    03/26/2022, 7:10 PM
    looking at github issues, this was supposedly resolved like a year ago?
  • t

    tandyman

    03/26/2022, 7:10 PM
    any thoughts?
  • t

    tandyman

    03/26/2022, 7:10 PM
    I'm stuck on a pretty important issue trying to build out this site.
  • f

    fanclubfm

    03/26/2022, 7:14 PM
    do you mind sharing what your resetPasswordForEmail call looks like? And what do you have in redirect section in supabase admin under authentication settings?
  • t

    tandyman

    03/26/2022, 7:14 PM
    let { data, error } = await supabaseClient.auth.api.resetPasswordForEmail(email, { redirectTo:
    ${window.location.origin}/reset
    })
  • t

    tandyman

    03/26/2022, 7:15 PM
    checking admin now
  • f

    fanclubfm

    03/26/2022, 7:15 PM
    can you try putting / after reset
  • f

    fanclubfm

    03/26/2022, 7:15 PM
    await supabase.auth.api.resetPasswordForEmail(emailRef.current.value, { redirectTo:
    ${window.location.origin}/login/recovery/
    , })
  • f

    fanclubfm

    03/26/2022, 7:15 PM
    this is how Im calling it and / at the end makes all the difference for some reason
  • f

    fanclubfm

    03/26/2022, 7:17 PM
    add in additional section http://localhost:3000/reset/
  • t

    tandyman

    03/26/2022, 7:17 PM
    I'm testing it locally, btw, with localhost:3000
  • t

    tandyman

    03/26/2022, 7:17 PM
    ahh
  • t

    tandyman

    03/26/2022, 7:18 PM
    that may be it
  • t

    tandyman

    03/26/2022, 7:18 PM
    sometimes the "fail silently" nature of things kills me
  • f

    fanclubfm

    03/26/2022, 7:18 PM
    yeah. additional urls have to list out full path of any url you might redirect to
  • t

    tandyman

    03/26/2022, 7:18 PM
    where it looks like a bug, but it's a security feature
  • t

    tandyman

    03/26/2022, 7:28 PM
    trying now
  • t

    tandyman

    03/26/2022, 7:30 PM
    still not updating, so I am restarting server to see if that helps
  • f

    fanclubfm

    03/26/2022, 7:34 PM
    Hmm. Hope you figure it out. The biggest issue for me was figuring out that / at the end. Without it it would always redirect to root. so if you in your redirectTo have ${window.location.origin}/reset/ and in supabase you have http://localhost:3000/reset/ it should work . At least that's how it works for me. Seems like there is alot of confusion over redirectTo in general. Check this discussion out. https://github.com/supabase/supabase/issues/5663
  • t

    tandyman

    03/26/2022, 7:38 PM
    Yep mine works now, suprisingly, without the slash, but only on localhost...maybe when I deploy it i'll hit the same issue
  • t

    tandyman

    03/26/2022, 7:38 PM
    and if I do, i'll add the slash
  • t

    tandyman

    03/26/2022, 7:38 PM
    Thank you so much!
  • t

    tandyman

    03/26/2022, 7:39 PM
    I think they should have error reporting or logging somewhere that shows you denied redirects to help troubleshoot when that occurs....
  • t

    tandyman

    03/26/2022, 7:39 PM
    At some point, when people move beyond generators and really start building apps, this is important stuff.
  • t

    tandyman

    03/26/2022, 7:40 PM
    I'm committing to this for a real project, so I'm hoping I don't run into too many things like this.
  • t

    tandyman

    03/26/2022, 7:40 PM
    Having discord and nice people like @User helps 🙂
  • f

    fanclubfm

    03/26/2022, 7:42 PM
    Thanks @User . I'm preparing to launch a real project within a week or two and really have not had too many major issues. Good luck.
  • t

    tandyman

    03/26/2022, 7:42 PM
    nice
  • t

    tandyman

    03/26/2022, 7:42 PM
    good luck!
1...535455...81Latest