Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda