Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
How to filter data in Loopback 4 with Auth plugin

Hi I'm quite new with loopback in general, so this question might be obvious.

I've followed this guide: https://mobilediana.medium.com/using-postgresql-with-loopback4-jwt-authentication-extension-d956ac707746 to install loopback4 with JWT plugin for auth. Everything went smoothly. I was able to login and the register process is working without any issues.

Now I have a requirement to create a new table account and the user should only see the account associated with his own user. I was thinking of making a relationship from the account to the user and then I could filter the query via the user id. However when I try to make a relationship from/to the user I'm confronted with an error on the CLI that the repo does not exist.

"Generation is aborted: Error: UserRepository class does not exist. Please create a repository first with "lb4 repository" command."

Well the solution seems quite obvious, I should just type the lb4 repository, create the repo and that's it. Well, the problem is that if I create a new repo for the user the JWT plugin stops working because my user repo overrides the ones from the plugin and well things break...

Maybe I've missed something but I don't find any information on how to achieve this. My repo here: https://github.com/jgomes94/kickstart-loopback-react.git

Any help or even an example repo where this is achieved would be very helpful. Thank you

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda