Skip to content
Discussion options

You must be logged in to vote

I finally managed to find what was wrong in my code. There were 2 errors in the AppProvider.ts file:

I needed to use AuthService, not the AuthService interface in the singleton.
And there was an unnecessary 'async'."

Here's the incorrect code:

this.app.container.singleton('App/Services/ServicesContracts/AuthServiceContract', async () => {  
      const userRepository = this.app.container.use('App/DataAccessLayer/DALContracts/UserContract')  
      return new AuthService(userRepository)  
})  

Here's the corrected code (only the first line):

this.app.container.singleton('App/Services/AuthService', () => {
     const userRepository = this.app.container.use('App/DataAccessLayer/DALContracts/…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RoyalVICTOR-pro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant