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

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -