Support for multiple user types by Passport-local mongoose node.js

前端 未结 3 2033
一个人的身影
一个人的身影 2020-12-29 16:48

I wanted two types of users logging in (User, Client). How exactly can I create localStrategies, serialize and deserialize user for both types in my app.js I have two separa

3条回答
  •  天涯浪人
    2020-12-29 17:32

    You can make role in mongoose schema and give it to user or client. Based on the role you can do the authentication

提交回复
热议问题