Skip to content
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

Merged
merged 10 commits into from
Dec 13, 2023
Merged

18 token #28

merged 10 commits into from
Dec 13, 2023

Conversation

seo-wo
Copy link
Member

@seo-wo seo-wo commented Dec 13, 2023

일단 refresh token 해결법은 다시 시도해보겠습니다.

그 외 access_token과 login api 가 제대로 동작하게끔 바뀌었습니다.

add refresh token guard and strategy

#18
wip: refresh token - refreshGuard does not work
when signup, get image url as profile image

#18
manage refresh token in User table

#18
use prettierrc much prettier code convention
Copy link
Member

@sideseal sideseal left a 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);
Copy link
Member

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);
Copy link
Member

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 =
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 try-catch...

@@ -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} ${
Copy link
Member

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;
Copy link
Member

@Jiwon-Woo Jiwon-Woo Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saltRounds 해싱할 때도 쓰니까 공통 파일로 빼도 편할거 같네요

@seo-wo seo-wo merged commit ce8bcd3 into dev Dec 13, 2023
@Jiwon-Woo Jiwon-Woo added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Dec 13, 2023
@Jiwon-Woo Jiwon-Woo linked an issue Dec 30, 2023 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

인가를 위해 사용하는 token
3 participants