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

redirect_uri is lost #732

Open
brandoncc opened this issue Oct 20, 2015 · 0 comments
Open

redirect_uri is lost #732

brandoncc opened this issue Oct 20, 2015 · 0 comments

Comments

@brandoncc
Copy link

I have a scenario where I need to redirect to a different url for creating users, as I don't want it to happen automatically in the same controller action as a user signing in. I have tried attaching a redirect_uri to my oauth request to Github but it gets lost in the sorcery code.

First request url (correct, includes /create):

http://0.0.0.0:3000/oauth/github?redirect_uri=http%3A%2F%2F0.0.0.0%3A3000%2Foauth%2Fcallback%2Fcreate%3Fprovider%3Dgithub

Next request in network tab (/create is gone):

https://github.com/login/oauth/authorize?client_id=***&display=&redirect_uri=http%3A%2F%2F0.0.0.0%3A3000%2Foauth%2Fcallback%3Fprovider%3Dgithub&response_type=code&scope=&state=

I have followed the flow of the code and it appears that authorize_url doesn't have any way to support this currently. Is there a recommended way to use separate controller actions for signing in and registering?

By the way, I changed my oauth controller action to:

def oauth
  login_at(auth_params[:provider], redirect_uri: auth_params[:redirect_uri])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant