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

123
Visualizações
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 à 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