Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
Multi type user authentication in nodejs and mongodb

I want to develop a multi-vendor e-commerce backend. It has 4 types of users.

  1. Customer
  2. vendor
  3. staff
  4. admin

If I use a collection model and user_type to handle 4types of users then a staff/vendor will not able to register as a customer. If I use different collection models for different types of users then there will be too many routes. I need to develop login, register, update, getOne, getAll routes for each type of user.

So, which is the best way to design a collection for multi-type users and manage routes in efficient way.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can manage in same collection like email with user_type, if email already registered as staff or vender(user_type like staff/vendor) restrict user to register as a customer. You can easily manage using email with user_type check.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!