add:product price
This commit is contained in:
@@ -13,17 +13,9 @@ import { AuthController } from './auth.controller';
|
||||
property: 'user',
|
||||
session: false,
|
||||
}),
|
||||
JwtModule.register({
|
||||
secret: process.env.SECRETKEY, signOptions: {
|
||||
expiresIn: process.env.EXPIRESIN,
|
||||
},
|
||||
}),
|
||||
],
|
||||
controllers: [AuthController],
|
||||
providers: [AuthService, JwtStrategy],
|
||||
exports: [
|
||||
PassportModule,
|
||||
JwtModule
|
||||
],
|
||||
exports: [PassportModule, JwtModule],
|
||||
})
|
||||
export class AuthModule {}
|
||||
|
||||
@@ -10,19 +10,19 @@ export class LocalStrategy extends PassportStrategy(Strategy) {
|
||||
super();
|
||||
}
|
||||
|
||||
async validate(
|
||||
username: string,
|
||||
password: string,
|
||||
): Promise<Omit<User, 'password'>> {
|
||||
const user = await this.authService.validateUser({
|
||||
username,
|
||||
password,
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
throw new UnauthorizedException();
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
// async validate(
|
||||
// username: string,
|
||||
// password: string,
|
||||
// ): Promise<Omit<User, 'password'>> {
|
||||
// const user = await this.authService.validateUser({
|
||||
// username,
|
||||
// password,
|
||||
// });
|
||||
//
|
||||
// if (!user) {
|
||||
// throw new UnauthorizedException();
|
||||
// }
|
||||
//
|
||||
// return user;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user