Closed rumsky closed 4 years ago
Any news on this one ? Any service dependent on Request scope will break the passport.
I am in the same situation of @rumsky
I encountered same issue in a project which I created from scratch. But sample 19-auth-jwt in this repository is working just fine. I could not find the difference between this sample and my project.
same here any updates?
i repeated all steps in that nest.js guide and somehow it started work :) seems that i forgot to add a module or so...
Sorry, I encountered this problem because I miss provide 'LocalStrategy' in auth.module.ts. Please check your providers and imports
auth/auth.module.ts
import { Module } from '@nestjs/common';
import { AuthService } from './auth.service';
import { UsersModule } from '../users/users.module';
import { PassportModule } from '@nestjs/passport';
import { LocalStrategy } from './local.strategy';
@Module({
imports: [UsersModule, PassportModule],
providers: [AuthService, LocalStrategy],
})
export class AuthModule {}
I faced the same problem, and the solution was to add the AuthModule
in the imports of my app module (app.module.ts
).
@cjancsar why downvoting my comment though?
Bug Report
Current behavior
follow the docs https://docs.nestjs.com/techniques/authentication. This is a error :"Error: Unknown authentication strategy "local""
Environment