Description
Is your feature request related to a problem? Please describe.
I'm frustrated when I had the site_url
and additional_redirect_urls
values set to a URL host of 127.0.0.1
, and my redirect URL when inviting users by email uses localhost
, but the invite link does not redirect to the additional url value, but only the site URL.
For example, if I had my config.toml file auth settings set to:
site_url = "http://localhost:4000"
additional_redirect_urls = ["http://localhost:4000/mypage"]
But the redirect URL used when using the Supabase client API to invite a user via email is like below:
const { data: inviteData, error: inviteError } = await client.auth.admin.inviteUserByEmail(email, {
data: {
firstName,
lastName,
},
redirectTo: "http://127.0.0.1:4000/set-password",
});
I could not figure out what was going on so I created a post on the discord server, and after some discussion with garyaustin
and silentworks
, we figured out that one of my issues was that the config.toml URL host values needed to be the same as the host value in the redirect URL that I was using in my code.
I can see how this might be confusing or frustrating for users since they are considered one and the same host.
Describe the solution you'd like
When developing locally, if the user uses a mix between localhost
or 127.0.0.1
for the host in any of the redirect URLs in code, and the site_url
and additional_redirect_urls
, locally, the invite link should still work.
Describe alternatives you've considered
If this cannot be done, possibly clear error and/or warning messages, and implement documentation that they should be the same.
Additional context