supabase
supabase copied to clipboard
Session is not detected from URL
Version
@nuxtjs/supabase: nuxt:
Hi I've started facing an issue when the access_token is kept in the url and user is not detected/logged in.
I have no warning or error niether in the console nor in the server console. So I would like to ask how Is there any way how could I test it more deep. I've set the config explicitly
clientOptions: {
auth: {
detectSessionInUrl: true,
},
but it didn't help. Thanks for help :pray:
Hi,
I have exactly the same issue. I tried to set the session using the url access_token and refresh_token once the page is mounted to make sure those are valid and it works in the mean time I use this.
onMounted(async () => {
const { data, error } = await client.auth.setSession({
access_token: route.hash.split('&')[0].split('=')[1],
refresh_token: route.hash.split('&')[3].split('=')[1]
})
if (error) {
console.log(error)
} else {
console.log(data)
}
})
Thanks for your help.
I have the same problem
Hi,
I have exactly the same issue. I tried to set the session using the url access_token and refresh_token once the page is mounted to make sure those are valid and it works in the mean time I use this.
onMounted(async () => { const { data, error } = await client.auth.setSession({ access_token: route.hash.split('&')[0].split('=')[1], refresh_token: route.hash.split('&')[3].split('=')[1] }) if (error) { console.log(error) } else { console.log(data) } })
Thanks for your help.
Thank you! I too have been dealing with this problem and this workaround is a huge help until there is a permanent fix.
I have the same problem, regarding password reset. It work fine, as long as I stay in the same browser, but when I click on the Reset Password link in the E-Mail I got, and I open it on a different browser or device, I get the same Error and cannot reset my password.
Hi,
I have exactly the same issue. I tried to set the session using the url access_token and refresh_token once the page is mounted to make sure those are valid and it works in the mean time I use this.
onMounted(async () => { const { data, error } = await client.auth.setSession({ access_token: route.hash.split('&')[0].split('=')[1], refresh_token: route.hash.split('&')[3].split('=')[1] }) if (error) { console.log(error) } else { console.log(data) } })
Thanks for your help.
@romainpauli Thank you bro, thats work.
I have the same problem, regarding password reset. It work fine, as long as I stay in the same browser, but when I click on the Reset Password link in the E-Mail I got, and I open it on a different browser or device, I get the same Error and cannot reset my password.
That's working as intended. The Nuxt module uses the PKCE flow, which means you have to use the same device/browser.
I'm shocked you got it working at all though, even in the same browser. I can't get mine to work at all. It just keeps saying Auth Session Missing. Would love to see how you did it.
Edit: Nevermind. My issue was that I was using the password reset email even for logged in users. It would send the email, then log the user out, then redirect them to the home page. Logging the user out was deleting all the cookies, including the one set by the resetPasswordForEmail one.