Skip to content

Commit

Permalink
feat/#39/refresh 토큰이 문자열 그대로 저장되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gwgw123 committed Dec 20, 2024
1 parent bb3fb6a commit 33d27e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- backend # 'backend' 네트워크 사용

redis:
image: redis:7-alpine
image: redis:7.2.6
command: redis-server /usr/local/etc/redis/redis.conf --requirepass $REDIS_PASSWORD
volumes:
- ./conf/redis.conf:/usr/local/etc/redis/redis.conf
Expand Down
4 changes: 0 additions & 4 deletions src/auth/jwt/jwt.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ export class JwtGuard implements CanActivate {
throw new UnauthorizedException('No Access Token provided');
}

console.log(accessToken);

// access 토큰 변조, 만료를 검사
const payload = jwt.verify(
accessToken,
this.configService.get<string>('ACCESS_SECRET'),
) as any;

console.log(payload);

const { userId } = payload;
const user = await this.usersService.getUser(userId);

Expand Down
4 changes: 4 additions & 0 deletions src/auth/redis/redis.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import * as redisStore from 'cache-manager-redis-store';
port: configService.get<number>('REDIS_PORT'),
password: configService.get<string>('REDIS_PASSWORD'),
ttl: configService.get<number>('REDIS_EXPIRATION_TIME'),
serializer: {
serialize: (value) => value, // 데이터를 그대로 저장
deserialize: (value) => value, // 데이터를 그대로 반환
},
}),
inject: [ConfigService],
}),
Expand Down

0 comments on commit 33d27e9

Please sign in to comment.