-
Notifications
You must be signed in to change notification settings - Fork 105
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
Logging in always redirects you to the homepage #1161
Comments
I am willing to work on this issue. |
github apps have a callback url the user is authorized to redirect the user back to the application. You can add custom redirect_uri's as query parameters at the end of the authorization request. The trick is, is that the redirect_uri has to use the callback url as the base url but you can extend it with another query parameter to redirect from http://decomp.me/login to wherever the user was perviously. Simply get the current url from wherever the user was when they selected the github login button and attach that as a an extended redirect_uri. Then when that gets passed to the login page parse the query_param and redirect the user back to where they were. Here's what the current request url is (src/lib/oauth.ts):
Here's an example of how you can use the redirect_uri (google is just an example but you'd want to redirect to where the user previously was):
EDIT: |
To Reproduce
Expected behavior
You're on the same scratch page you were at, but logged in.
**Actual behavior
You get redirected to the front page.
Conversely, logging out behaves as expected; you stay at the page you're at.
The text was updated successfully, but these errors were encountered: