-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject repository in oauth provider #2541
Comments
Which class expects to inject |
@raymondfeng , my
|
Can u upgrade to latest version of loopback? We recently fixed a similar issue. Let’s make sure. |
I tried the latest and still saw the issue. Here are my deps:
|
Do you have UserInfoRepository bound to the context? For example, in src/repositories folder? |
That's a good question. I do have it in
|
Can you run the app with |
You don't have to call |
Here are the logs. The only thing that sticks out to me is
|
This is interesting. We close the request context using |
@DatGuyJonathan Do you want to try to run |
Thanks for the suggestion @raymondfeng . Could there be an event instead that I can trigger to close the request when I'm ready? |
I don't find an event that fits your scenario. I think the key is to find out when Passport finishes the callback. Is it possible to create a sandbox app to reproduce the problem? If so, I can help troubleshoot. |
IMO, passport framework should finishes |
I had the same problem? how can we fixed! ? Regards. |
Description / Steps to reproduce / Feature proposal
I'm trying to use a couple of repositories in an oauth2 flow. The setup is similar to #1835 where I have a
verify
function that I want to try calling the repositories. The error is:Error: The key repositories.UserInfoRepository was not bound to any value
The organization and user models have a has-many/belongs-to relation so creating a user with the org repository is supposed to invoke the user repository. I followed https://loopback.io/doc/en/lb4/HasMany-relation.html to setup the models & repos. I think I have the repositories and models wired up correctly because I can move the logic into a controller and it works fine.
Any ideas what I need to bind/inject?
The text was updated successfully, but these errors were encountered: