将蒸汽authentication与前端框架集成

我目前正在开发一个应用程序与Node.js后端和vue.js作为前端框架。 作为login应用程序,我正在使用护照蒸汽,在后端完美地工作。 用户被redirect到前端以便login,后端处理login并返回req.user。 在后端检查user.isAuthenticated作品。 我的问题是如何将用户信息和用户身份validation的会话传递给前端客户端?

服务器代码:

app.get('/auth/steam/return', passport.authenticate('steam', { failureRedirect: '/' }), function(req, res) { res.redirect('http://localhost:8080/#/index'); }); app.get('/account', ensureAuthenticated, function(req, res){ res.send({user: req.user}); }); 

当用户通过蒸汽authentication成功后,他被redirect到前端 – > localhost:8080 /#/ index,创build一个axios请求到localhost:/ 3001 /账户后端。 不幸的是前端请求没有被authentication。 有什么build议么 ?

非常感谢 !!