Skip to content

Commit

Permalink
chore: remove console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
seo-wo committed Dec 13, 2023
1 parent 4a4a33b commit 468abdd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export class AuthController {
const accessToken = await this.authService.generateToken(newUser);
const refreshToken = await this.authService.generateRefreshToken(newUser);
await this.authService.setCookie(res, newUser.id, null, refreshToken);
console.log('signup', accessToken);
res.send({
message: 'success',
access_token: accessToken,
Expand All @@ -105,7 +104,6 @@ export class AuthController {
@UseGuards(JwtRefreshGuard)
async logout(@Req() req: Request, @Res() res: Response) {
this.logger.debug(`logout`);
// console.log('logout', req.headers);
// await this.authService.deleteRefreshToken(user.id);
res.clearCookie('refresh_token');
res.clearCookie('google_token');
Expand Down
2 changes: 0 additions & 2 deletions src/auth/guard/jwt-refresh.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export class JwtRefreshGuard extends AuthGuard('jwt-refresh') {
}

async canActivate(context: ExecutionContext): Promise<boolean> {
console.log('JwtRefreshGuard');
const token = this.getToken(context);
const result = await this.validateToken(token);
return result;
Expand All @@ -33,7 +32,6 @@ export class JwtRefreshGuard extends AuthGuard('jwt-refresh') {
const result = verify(token, process.env.JWT_REFRESH_SECRET, {
ignoreExpiration: false,
});
console.log('validateToken', result);
return true;
} catch (error) {
return false;
Expand Down
4 changes: 1 addition & 3 deletions src/auth/strategy/jwt-refresh.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class JwtRefreshStrategy extends PassportStrategy(
}

// async validate(req: Request, payload: any) {
// console.log('JwtRefreshStrategy');
// const refreshToken = req?.cookies?.Refresh;
// try {
// const user = await this.userService.isRefreshTokenVaild(
Expand All @@ -41,11 +40,10 @@ export class JwtRefreshStrategy extends PassportStrategy(
// }
// }
// async validate(payload: any, done: VerifyCallback) {
// console.log('JwtRefreshStrategy');
// try {
// done(null, payload);
// } catch (error) {
// throw new UnauthorizedException('Unauthorized', '401');
// }
}
// }
}

0 comments on commit 468abdd

Please sign in to comment.