You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.
With the callback & redirect on the 3rd party providers, there is no way to return to the previous page prior to logging in.
Approach:
Ability to add a query param with the returnUrl to the auth route: like this api/v1/auth/$provider?returnUrl=$url
Set req.session.returnUrl = req.query.returnUrl when receiving the auth call in the controller
After receiving the callback from 3rd party, check the existence of session.returnUrl and use that instead of the config.login route - or add the url as a queryParam to the login redirect route (and remove session.returnUrl).
Will open PR on this later if you'd like...
The text was updated successfully, but these errors were encountered:
If there a way to make it work without sessions I will prefer this solution as I generally don't enable sessions when I use JWT. If ?returnUrl=$url can work go for this solution. And yes after connect/login with third party we check this param and redirect to that URL or config.login if empty.
Sorry if I can't currently help you to do that.
@jaumard It's possible, but I gave this a thought and probably makes a lot more sense to just handle this on the frontend and store in the local storage when clicking the auth/provider url. I don't think this trailpack should be handling this. Do you agree?
In some cases you cannot manage this in the front end, or you will be redirected to /login and then manually redirect to another page witch can look weird in the browser. I think it can be nice if it can manage here but it's not really mandatory for now :)
@JAertgeerts I implemented this functionality on this branch https://github.com/jaumard/trailpack-passport/tree/feature/third_party work by using redirectTo query param, and only if you enable sessions. I can't merge the branch yet as I have trouble with the mongoose ORM which is broken.
If you're using it and have time to take a look please help :)
Thx
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
With the callback & redirect on the 3rd party providers, there is no way to return to the previous page prior to logging in.
Approach:
api/v1/auth/$provider?returnUrl=$url
req.session.returnUrl = req.query.returnUrl
when receiving the auth call in the controllerWill open PR on this later if you'd like...
The text was updated successfully, but these errors were encountered: