【发布时间】:2021-05-12 02:10:09
【问题描述】:
在这种情况下,如何将另外 2 个字段作为用户名传递?我想通过 phone_number 和 SSA 登录,而不仅仅是使用电子邮件。
export class LocalStrategy extends PassportStrategy(Strategy) {
constructor(private authenticationService: AuthenticationService) {
super({
usernameField: 'email'
});
}
async validate(email: string, password: string) {
return this.authenticationService.getAuthenticatedUser(email, password);
}
}
【问题讨论】:
标签: node.js express passport.js nestjs passport-local