chops
04/22/2022, 8:26 PMNeedle
04/22/2022, 8:26 PM/title
command!
We have solved your problem?
Click the button below to archive it.chops
04/22/2022, 8:28 PMgaryaustin
04/22/2022, 8:36 PMSign in with redirect.#
Note that the redirectTo param is only relevant for OAuth logins, where the login flow is managed by the Auth server. If you are using email/phone logins you should set up your own redirects (within the email/sms template).
This says why.
https://github.com/supabase/supabase/issues/5663#issuecomment-1074427708Needle
04/22/2022, 8:36 PMchops
04/22/2022, 8:46 PMchops
04/22/2022, 8:47 PMchops
04/22/2022, 8:50 PMfinal response = await supabase.auth.signIn(
email: _emailController.text,
options: AuthOptions(
redirectTo: kIsWeb
? null
: 'com.example.example://login-callback/'));
which on mobile will generate a magic link email containing a link like https://id.supabase.co/auth/v1/verify?token=token&type=magiclink&redirect_to=com.example.example://login-callback/, on web the redirect_to is set to the site url, like http://localhost:3000 or whatever
But in the C# app, I'm attempting to do the identical workflow, except the redirect_to parameter is always only set to the site urlLennart
04/22/2022, 9:05 PMLennart
04/22/2022, 9:07 PMgaryaustin
04/22/2022, 9:09 PMgaryaustin
04/22/2022, 9:12 PMchops
04/22/2022, 9:30 PM/auth/v1/magiclink?redirect_to=com.example.example://login-callback
with a POST body simply containing {\x22email\x22:\x22dan@redchops.com\x22}
(escape characters are just how nginx logs it)
The C# library configured the exact same way POSTs to
/auth/v1/magiclink
and puts the redirect_to parameter in the POST body, so it seems like Gotrue ends up ignoring itLennart
04/22/2022, 9:37 PMmagiclink
endpoint is depecrated, according to https://github.com/supabase/gotrue README and the redirectTo
parameter is not mentioned at all.Lennart
04/22/2022, 9:38 PMotp
endpointgaryaustin
04/22/2022, 9:40 PMchops
04/22/2022, 9:41 PMgaryaustin
04/22/2022, 9:41 PMchops
04/22/2022, 9:44 PMLennart
04/22/2022, 9:54 PMLennart
04/22/2022, 9:55 PMredirectTo
in the body should workgaryaustin
04/22/2022, 10:00 PMHey everyone, just a heads up, the redirect_to param only works for oauth logins and not password-based / magiclink / phone otp sign-ins. This is because for password-based / magiclink / phone otp sign-ins, we make a POST request to gotrue and redirecting the response would change it to a GET request, which means that the response body would be lost.
for what is worthchops
04/22/2022, 10:01 PMLennart
04/22/2022, 10:08 PMredirectTo
in a json body is not supported.chops
04/22/2022, 10:08 PMchops
04/22/2022, 10:08 PMLennart
04/22/2022, 10:08 PMchops
04/22/2022, 10:09 PMLennart
04/22/2022, 10:10 PMgaryaustin
04/22/2022, 10:35 PMhttps://ugccqefilvseqbseypbq.supabase.co/auth/v1/otp?redirect_to=http%3A%2F%2Fsommapp.us%2Fsomm
and redirectTo works fine for magic link.... I'm not sure why the Mar comment and doc change, unless it was fixed later?chops
04/22/2022, 10:38 PMgaryaustin
04/22/2022, 10:40 PMgaryaustin
04/22/2022, 10:54 PM