Is there an existing issue for this?
Current behavior
I'm using the local strategy with phone field instead of username, so I need to set the usernameField to phone at the super call:
@Injectable()
export class LocalStrategy extends PassportStrategy(Strategy) {
constructor(private readonly authService: AuthService) {
super({ usernameField: "phone" });
}
async validate(phone: string, password: string) {
const user = await this.authService.validateUser(phone, password);
return user;
}
}
But by doing this, typescript yells at me that super() does not receive any arguments. But if I remove it the authentication fails.
Minimum reproduction code
N/A
Steps to reproduce
N/A
Expected behavior
Proper typings.
Package version
11.0.2
Passport version
passport-jwt 4.0.1; passport-local 1.0.0
NestJS version
11.0.1
Node.js version
22.12.0
In which operating systems have you tested?
Other
Am I doing it right? Should I just use @ts-ignore?
Is there an existing issue for this?
Current behavior
I'm using the local strategy with
phonefield instead ofusername, so I need to set theusernameFieldtophoneat the super call:But by doing this, typescript yells at me that
super()does not receive any arguments. But if I remove it the authentication fails.Minimum reproduction code
N/A
Steps to reproduce
N/A
Expected behavior
Proper typings.
Package version
11.0.2
Passport version
passport-jwt 4.0.1; passport-local 1.0.0
NestJS version
11.0.1
Node.js version
22.12.0
In which operating systems have you tested?
Other
Am I doing it right? Should I just use
@ts-ignore?