javascript - Custom returnURL not passing to Node.js Passport -
The second answer is here:
I am using a custom URL passed from front-end Like:
& lt; A href = "/ auth / meetup? Redirect = / chat / {{currentChatID}}" class = "btn btn-visit" & gt; & Lt; Span class = "FA FA-Meeting" & gt; & Lt; / Span & gt; & Lt; / A & gt; Where there is a redirection parameter, for example: ? Redirect = / chat / room1 and passport in:
app.get ('/ auth / meetup', function (req, res, next) {Req.session.redirect = req.query.redirect; next ();}, passport.authenticate ('of meeting')); App.get ('/ auth / meetup / callback', passport.authenticate ('meetup', {failureRedirect: '/'}), function (rick, ridge) {res.redirect (req.session.redirect || '/ Profile / world / meeting '); delete req.session.redirect;}); req.query.redirect parameter is undefined , so it will not redirect to the specified redirect URL, how do I pass URL correct In a proper way?
I have decided, to pass / s in the URL: <
Comments
Post a Comment