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

121
Views
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
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!