Skip to content

Password Recovery Does Not Update Auth Session #21

@vehm

Description

@vehm

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Password Recovery flow does not work as expected for @supabase/ssr v0.4.0, whereas the same code works for v0.3.0. Confirmations, invitations, and magic links seem to work just fine, but password recovery does not. It does not update the session if the type is set to "recovery".

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Set up SvelteKit SSR client as detailed here.
  2. Create Forgot + Change Password pages as detailed here.
  3. Update the Password Recovery email template to use the following template:
    {{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=recovery&next=/change-password
  4. Ensure that the version of @supabase/ssr is v0.4.0
  5. Attempt to reset password for a user through their email.
  6. When the user visits the reset link, authentication fails.
  7. Change the version of @supabase/ssr to v0.3.0
  8. Try the password reset flow again.
  9. It works.

Expected behavior

The password recovery flow for v0.4.0 of @supabase/ssr, as detailed here, should authenticate the user and redirect them to the "/change-password" page.

System information

  • Supabase SSR: 0.4.0

Additional context

I followed these guides:
https://supabase.com/docs/guides/auth/server-side/sveltekit
https://supabase.com/docs/guides/auth/passwords?queryGroups=flow&flow=pkce&queryGroups=framework&framework=sveltekit#resetting-a-password

A reference repo using v0.3.0 I used to confirm that the code worked, but updating it to v0.4.0 fails: https://github.com/j4w8n/sveltekit-supabase-ssr

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions