Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Email in Nexjts app directory SSR PKCE flow not working #26583

Open
shsunmoonlee opened this issue May 20, 2024 · 0 comments
Open

Change Email in Nexjts app directory SSR PKCE flow not working #26583

shsunmoonlee opened this issue May 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@shsunmoonlee
Copy link

shsunmoonlee commented May 20, 2024

Bug report

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

Describe the bug

Change Email in Nexjts app directory SSR PKCE flow returns error

AuthApiError: Error confirm email
    at handleError (webpack-internal:///(rsc)/./node_modules/@supabase/auth-js/dist/module/lib/fetch.js:74:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _handleRequest (webpack-internal:///(rsc)/./node_modules/@supabase/auth-js/dist/module/lib/fetch.js:117:9)
    at async _request (webpack-internal:///(rsc)/./node_modules/@supabase/auth-js/dist/module/lib/fetch.js:99:18)
    at async SupabaseAuthClient.verifyOtp (webpack-internal:///(rsc)/./node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:568:37)
    at async GET (webpack-internal:///(rsc)/./app/(auth)/auth/confirm/route.ts:21:46)

To Reproduce

turn Secure email change option off
Setup email auth template as following

<h2>Confirm Change of Email</h2>

<p>Follow this link to confirm the update of your email from {{ .Email }} to {{ .NewEmail }}:</p>
<p><a href="{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=email_change&redirect_to=account">Change Email</a></p>

send auth code by

    const { data, error } = await supabase.auth.updateUser(
      {
        email: values.email,
      }
    );

You'll get the error
AuthApiError: Error confirm email
at /auth/confirm route

Expected behavior

Should not cause error

Screenshots

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

@shsunmoonlee shsunmoonlee added the bug Something isn't working label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant