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

[Demo] Configure local Supabase instance to support invitation and password reset out of the box #77

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

slax57
Copy link
Contributor

@slax57 slax57 commented Oct 23, 2024

Problem

The documentation mentions how to customize the supabase emails to include the /auth-callback path in the links it contains. However the demo itself does not apply this configuration, and instead still requires the user to manually copy the link and replace the end of the URL, which is confusing (and no longer necessary).

Solution

Update the supabase local instance config as explained in the README to make it use the /auth-callback, so that it works without requiring a manual replacement.

@slax57 slax57 added the RFR label Oct 23, 2024
<body>
<h2>You have been invited</h2>
<p>You have been invited to create a user on {{ .SiteURL }}. Follow this link to accept the invite:</p>
<p><a href="{{ .ConfirmationURL }}/auth-callback">Accept the invite</a></p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the doc is actually correct on this. Looking at https://supabase.com/docs/guides/auth/auth-email-templates#terminology, it seems the ConfirmationURL already contains the redirect_to parameter.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After investigation, it appears this is the wrong solution. We shouldn't need to change the email template for the /auth-callback. Instead, we should modify the authProvider so that it specify the /auth-callback route as the redirectTo parameter of the supabase method calls that need it.

However, this change might break existing applications that followed the current documentation, so this is a breaking change.

@djhi djhi added this to the 3.2.1 milestone Oct 24, 2024
@djhi djhi merged commit 796bb8d into main Oct 24, 2024
5 checks passed
@djhi djhi deleted the demo-invite-emails branch October 24, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants