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

Various Ways of Password Reset #1767

Open
BlakeQG opened this issue Sep 5, 2024 · 0 comments
Open

Various Ways of Password Reset #1767

BlakeQG opened this issue Sep 5, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@BlakeQG
Copy link

BlakeQG commented Sep 5, 2024

Improve documentation

Reset Password PKCE flow

Describe the problem

Two improvements here
(1)
In the document about password reset, it mentions the email template should contain the following HTML:

<h2>Reset Password</h2>

<p>Follow this link to reset the password for your user:</p>
<p>
  <a
    href="{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=recovery&next=/account/update-password"
    >Reset Password</a
  >
</p>

But it seems it is not necessary, the default {{ .ConfirmationURL }} follows this way. Below is the one I saw with {{ .ConfirmationURL }} .

https://*.supabase.co/auth/v1/verify?token=pkce_c65f725910287515426803ca*&type=recovery&redirect_to=https://subscription-*.vercel.app/auth/reset_password.

The only thing is during the resetPasswordForEmail, we need to provide the redirectTo parameter.

  const { error } = await supabase.auth.resetPasswordForEmail(email, {
    redirectTo: getURL("/auth/reset_password"),
  });

(2) In the document it mentions it usesverifyOtp for verification. But it seems exchangeCodeForSession should work as well. Please explain if any difference.

Describe the improvement

Add a section to explain different approaches and their pros and cons.

@BlakeQG BlakeQG added the documentation Improvements or additions to documentation label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant