-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
18 token #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인 완료했습니다!! try-catch로 감싸면 좋은 부분 제외하고는 모두 좋은 것 같아요
if (refreshToken) { | ||
await this.userService.updateRefreshToken(userId, refreshToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분도 비동기 함수가 있는데 try-catch로 감싸는게 어떨까요...?!?
refreshToken: string, | ||
userUid: number, | ||
): Promise<UserEntity | null> { | ||
const user: UserEntity | null = await this.findOneByUid(userUid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분도 try-catch로 감싸는건 어떨까요...
userUid: number, | ||
refreshToken: string, | ||
): Promise<void> { | ||
const hashedRefreshToken: string = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 try-catch..?!?!
} | ||
|
||
async deleteRefreshToken(userUid: number): Promise<void> { | ||
await this.userRepository.deleteRefreshToken(userUid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 메모...
refreshToken: string, | ||
refreshTokenExpiredAt: Date, | ||
): Promise<void> { | ||
const user: UserEntity = await this.findOneByUid(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 try-catch...
src/auth/guard/jwt.guard.ts
Outdated
@@ -12,18 +12,13 @@ export class JwtGuard extends AuthGuard('jwt') { | |||
async canActivate(context: ExecutionContext): Promise<boolean> { | |||
if (context.getType() === 'http') { | |||
this.logger.debug( | |||
`canActivate [http, ${context.getArgs()[0].method} ${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPP 모듈 05를 끝내서 그런지 try-catch를 자꾸 감싸고 싶어지네요...
} | ||
|
||
private async hashedRefreshToken(refreshToken: string): Promise<string> { | ||
const saltRounds = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saltRounds 해싱할 때도 쓰니까 공통 파일로 빼도 편할거 같네요
일단 refresh token 해결법은 다시 시도해보겠습니다.
그 외 access_token과 login api 가 제대로 동작하게끔 바뀌었습니다.