-
Notifications
You must be signed in to change notification settings - Fork 2
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
장소 모듈에 유저 모듈 연동해 권한 확인 및 AuthUser 데코레이터 버그 수정 #84
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.
수고하셨습니다~
제가 놓친 부분을 고쳐주셨네요 ㅎㅎ
더미 데이터 수정한거 올리는 김에 제가 수정했습니다! ( resolved 표시한 리뷰 )
남은 하나만 고민해봐 주시면 될 것 같아요!
const course = await this.courseService.getCourseById(courseId); | ||
if (course.user.id !== userId) { | ||
throw new CoursePermissionException(courseId); | ||
} |
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.
p2.
const courseOwnerId = await this.courseService.getCourseOwnerId(courseId);
if (courseOwnerId !== userId) {
throw new CoursePermissionException(courseId);
}
메서드 추가해서
이렇게 필요한 부분만 조회하는건 어떨까요?
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.
수고하셨습니다.
userId 부분 number 로 되어있던 것 저도 놓쳤던 거 같네요…
📄 Summary
AuthUser
데코레이터에서 타입 검사 버그 수정Token
추출 과정에서 토큰은 있지만 빈 값일때 예외 처리 추가(auth/utils.ts -> extractBearerToken)
Guard
생성 (CoursePermissionGuard
)🙋🏻 More
a. 성공 (토큰 O)
b. 실패 (토큰 O, 빈 값 토큰)
c. 실패 (토큰 X)
a. 성공 (토큰 O)
b. 실패 (토큰 X)
a. 성공 (토큰 O, 권한 O)
b. 실패 (토큰 O, 권한 X)
c. 실패 (토큰 X)
🕰️ Actual Time of Completion
close #83