You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can't inject in the constructor because the interface.AuthProvider doesn't allow it.
How you did it in your first example is right, although you don't need the httpContext, since the getUser method receives req, res, and next already.
I suspect there's something wrong with your container configuration. Your logger is most likely a simple class instance without any of its dependencies and should be bound with toConstantValue().
Also, you should use generics with bind methods: this.container.bind<DBService>(DBService.name).to(DBService).inSingletonScope()
If you don't, Inversify will struggle to resolve your bindings. At least I've had issues in the past when I've tried to leave out the generic.
i'm trying initialize AuthProvider as described on readme.
but i can not inject dependency in my CustomAuthProvider
If inject without constructor as described on readme, All injected dependencies are undefined.
And if inject a dependency to CustomAuthProvider on constructor of CustomAuthProvider, error occured on line of initializing InversifyExpressServer.
How can i use another dependencies on CustomAuthProvider?
The text was updated successfully, but these errors were encountered: