supabase icon indicating copy to clipboard operation
supabase copied to clipboard

Problem with PKCE and `generateLink()`

Open lukaszflorczak opened this issue 10 months ago • 2 comments

Version

@nuxtjs/supabase: v1.1.2 nuxt: v.3.6.5

Problem description

Hi, I attempted to update my authentication flow to include PKCE, but I've encountered an issue during the registration and email confirmation process.

Some details about my implementation:

  1. I disabled the redirect option, because I had implemented my own middleware to manage the necessary redirects.
  2. For user registration, I utilize a local API endpoint to generate a link and send a confirmation email via Postmark, as demonstrated in the code snippet below:
await client.auth.admin.generateLink({ type: 'signup', email, password, redirect_to })

Here's the problem: When I click the confirmation link with PKCE enabled, the user is redirected to my verification page, but they are not automatically logged in. I can see all the tokens and parameters in the URL, but the user session is not established. I also attempted to redirect the user to the callback page, but the result remains the same.

Is there something I might be overlooking or is there a configuration issue causing this behavior?

lukaszflorczak avatar Sep 27 '23 20:09 lukaszflorczak