OAuth skill issue
Ok thats 100% skill issue on my part.. but the flow that i know is:
Click "Sign In with Github" for example Redirect to Github OAuth login page Redirect back to my Urlwhen clicking on button which has: all i get is my redirect request... anyone can point me to how i should be done? Thank you ❤️
8 Replies
that is the correct behaviour not sure what you exactly need.
the flow above thats not what happening.. all i get is a redirect with the signin/signup
if it's returning the url but not actually redirectign make sure you haven't disabledFetchPlugins on your
createAuthClient
config. You can also just redirect to the url yourself using window.location.href
. Alos if you're using next make sure you're not calling it on the server (using server actions).i don't have disabledFetchPlugins.
And to be clear i get redirect to my endpoint
/api/auth/sign-in/social
when in practice i want it to go to github sign-in page and go back to my redirect url...Okay so if I understand you correctly what should be happening is:
A URL to redirect the user to after signing in.
-
A URL to redirect the user to if they are newly registered.
Useful when different routes are used for new and existing users.
-
A URL to redirect the user to if an error occurs.
If authentication is initiated from the client SDK, this defaults to the current URL.
-
The OAuth2 provider to use.
-
A boolean flag to disable automatic redirection to the provider.
Useful if you want to handle redirection manually, such as in a popup or a different tab.
click button -> redirect to github oauth page -> redirect to redirect uri
but what is currently happening is:
click button -> redirect to redirect uri
Is that correct?
Also, for your convenience, these are all the options for the signIn.social
function:
- callbackURL
(optional)A URL to redirect the user to after signing in.
-
newUserCallbackURL
(optional)A URL to redirect the user to if they are newly registered.
Useful when different routes are used for new and existing users.
-
errorCallbackURL
(optional)A URL to redirect the user to if an error occurs.
If authentication is initiated from the client SDK, this defaults to the current URL.
-
provider
(required)The OAuth2 provider to use.
-
disableRedirect
(optional)A boolean flag to disable automatic redirection to the provider.
Useful if you want to handle redirection manually, such as in a popup or a different tab.
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
That could indeed also be the problem
Sorry for not responding i was out of town for a while.
i managed to make it work like this.. altho im not sure its the best way but it works.
( Client side )
( Server side )