auth-js icon indicating copy to clipboard operation
auth-js copied to clipboard

Confusion on gotrue.js working with redirectTo option for magiclink.

Open GaryAustin1 opened this issue 3 years ago • 2 comments

Bug report

This is more clarification is needed and then possibly a document change.

Back in March based on these https://github.com/supabase/gotrue-js/pull/253 , https://github.com/supabase/supabase/issues/5663#issuecomment-1074427708

Implies that gotrue.js can no longer use redirectTo for signIn with magiclink (email only, no password).

Several users in the forums believe it still works, others run into an issue and stop based on the docs.

It seems to still work.

To Reproduce

Setup signIn with email only and no password, redirectTo set to a subpage in website. Website URL set to base and approved redirects set to include the entire URL with subpage. Login and and email is sent with a redirect_to option in the url and does redirect to that subpage in the app...

https://ugccqxxxxxxxxxypbq.supabase.co/auth/v1/verify?token=bF3ZHLRPV9cr9kXWI_NJyQ&type=magiclink&redirect_to=http://mysite.us/page is the URL in the email...

Expected behavior

If redirectTo is still supported for magiclink Docs need to be updated to reflect that.

Screenshots

image

image

This user did more specific testing already:

https://github.com/supabase/supabase/issues/5663#issuecomment-1075951729 image

GaryAustin1 avatar Apr 22 '22 22:04 GaryAustin1

hey @GaryAustin1, thanks for pointing this out! yeah it works for the example you've mentioned because that's a GET request, we'll update the docs to make sure it's clear.

kangmingtay avatar Apr 23 '22 00:04 kangmingtay

PR needs to be made against supabase/supabase but transferring to GoTrue-js so we can triage internally

J0 avatar Jul 18 '22 07:07 J0

We've updated the docs for this already:

V1: https://supabase.com/docs/reference/javascript/v1/auth-signin V2: https://supabase.com/docs/reference/javascript/auth-signinwithotp

Gonna close this issue but please feel free to reopen or leave any feedback that if we can improve the docs around this

kangmingtay avatar May 16 '23 08:05 kangmingtay