supabase: Auth session missing on password reset flow
Version
@nuxtjs/supabase: “^1.0.2” nuxt: “^3.7.0”
After one successful password reset, I am unable to reset password of either the same user or other users. I get a failed to fetch error on the client and Auth session missing error on the console.
forgot p[password code
const client = useSupabaseClient()
const { error } = await client.auth.resetPasswordForEmail(email.value, {
redirectTo: `${useRuntimeConfig().public.baseUrl}/auth/new-password`
})
new password code
const client = useSupabaseClient()
const { error } = await client.auth.updateUser({
password: password.value
})
await client.auth.signOut()
Anyone able to complete this flow successfully?
Steps to reproduce
On redirect from supabase to the new-password page, this is the error on the console.
When user enters the new password and submits, user receives a failed to fetch error and below is error shows on the console.
What is Expected?
User will be able to go through entire flow and reset their password
What is actually happening?
User unable to complete flow. Flow worked once and after that has been failing with the errors as shown above.
About this issue
- Original URL
- State: open
- Created 10 months ago
- Reactions: 1
- Comments: 15
I’m having the same problem. It’s not a very good sign that this breaks while trying Supabase for the first time 😓
Versions:
I’ve tried both the SPA and the SSR route. Both give the same error. https://supabase.com/docs/guides/auth/auth-password-reset
SPA
reset.vue
manage.vue:
Interestingly I get this console error:
And this error log indicating a missing ‘auth’:
SSR
reset.vue
callback.js in /server/api/auth
Error on server-side:
What is this auth session? And how can I make this work?
@silentworks had a good comment in another repo: this auth flow (PKCE) only works if you open the link on the same browser/device because it uses cookies.
Unfortunately, that issue is now closed. And I have tried to make this work with the same browser+device. This leaves me to think that this issue is with this module and the way it handles that cookie.