There might be some typo's in the last code block. The .forRootAsync() method expects totally different parameters then the once you propose.
Ah, you're right. I forgot that the default of createConfigurableDynamicModule expects the module's name to be passed as the first parameter. I'll get that fixed
createConfigurableDynamicModule
for other noobs like me, we need to add AuthModule ex AuthModule.forRootAsync(AuthModule
AuthModule.forRootAsync(AuthModule
@Module({ imports: [ AuthModule.forRootAsync(AuthModule, { imports: [ConfigModule, UserModule], inject: [ConfigService, UserService], useFactory: (config: ConfigService, userService: UserService) => { return { secret: config.get('AUTH_SECRET_VALUE'), userService, }; }, }), ], })
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There might be some typo's in the last code block.
The .forRootAsync() method expects totally different parameters then the once you propose.
Ah, you're right. I forgot that the default of
createConfigurableDynamicModule
expects the module's name to be passed as the first parameter. I'll get that fixedfor other noobs like me, we need to add AuthModule ex
AuthModule.forRootAsync(AuthModule