【发布时间】:2021-09-01 11:05:50
【问题描述】:
大家好。我在MERN学习和学习。我还创建了一个项目。现在我不相信我所做的是对的。现在这对我很重要。对不起我的英语:)
我在网上看过很多项目,但大部分项目使用的方法与我的不匹配。例如,许多人使用 jwt 进行身份验证。但我使用 passportjs 和 passport-local-mongoose。我成功注册并登录了 backen(express)。在前端每个组件中,我使用操作( redux )来获取用户信息是否登录:
UseEffect( ()=>{
User_Auth(12); // why 12? If I didnt write this value
// action cannot work but when I put work
// well and this value I cant do with.
} )
这个方法是真的吗?如果你想看这个简单的项目,请看这个:https://github.com/Feruz00/login_register/tree/master
谢谢
【问题讨论】:
标签: javascript reactjs express redux passport-local-mongoose