res.redirect doesn't redirect Node/Express.js
问题 I'm using Express for my webapp and I'm checking to see if some value doesn't exists in session, redirect the user to instagram login page. But in the console I keep getting 302 code and the browser doesn't redirect the user here is my code. I'm sending my requests using Ajax. function requireLogin (req, res, next) { if (!req.token) res.redirect('/auth'); else next(); }; app.get('/auth',function(req,res,next){ res.redirect("https://api.instagram.com/oauth/authorize/?client_id="+client_id+"