如何一起使用passportjs和reactjs? [英] How can I use passportjs and reactjs together?

查看:70
本文介绍了如何一起使用passportjs和reactjs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 reactJs 中有 3 个视图(主页、注册、登录),我想在我的项目中使用通行证,但我不知道该怎么做,我配置了通行证并且 url 有效.

I have 3 views, (Home, signup, login)made in reactJs, I want to use passport in my project but I dont know how to do it, I have passport configurated and it url is working.

如何像在 ejs 或 jade 中那样管理会话和用户数据?

What can I do to manage the session and the user data like we do in ejs or jade?

推荐答案

您可以将passport.js 与node.js 一起使用,也可以使用jsonwebtoken ,我个人使用它非常有用,易于编码且非常安全且易于使用前端带有反应或任何其他前端框架.最好的事情是后端:-> node.js +passport.js + jsonwebtoken前端:-> 反应/任何其他框架 + redux它真的很棒.

You can Use passport.js with node.js and also can use jsonwebtoken ,i personally use that very usefull simple to code and pretty secure and easily can use to frontend with react or any other frontend framework . The best thing is backend :-> node.js + passport.js + jsonwebtoken frontend :-> react/ any other framework + redux it works really awesome.

这篇关于如何一起使用passportjs和reactjs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆