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

Add Msw account api #5

Merged
merged 5 commits into from
Jan 5, 2025
Merged

Add Msw account api #5

merged 5 commits into from
Jan 5, 2025

Conversation

cjhih456
Copy link
Collaborator

주요 작업목록

  1. msw를 위한 token 함수 정의
  2. msw의 higher order resolver를 활용한 [error, auth] middleware 구성
  3. msw에 unhandled request 정의
  4. msw account api 정의
    • [POST] login
    • [POST] emailCheck
    • [GET] account/me

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@cjhih456 cjhih456 self-assigned this Jan 1, 2025
@cjhih456 cjhih456 requested a review from virere January 1, 2025 07:58
const parsedHeader = String(header.get('Authorization') || ' ').split(' ');
try {
const result = await jwtDecrypt<JwtPayloadType>(parsedHeader[1], secret)
if (!result) throw new Error()
Copy link

Choose a reason for hiding this comment

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

여긴 에러 메시지 필요없을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

현재 설계상 parseAuth의 경우 이미 auth verification이 이루어진 다음 step에서 이루어지기 때문에 거의 무조건 반환되어야 하는 값입니다.
다만, 휴먼미싱이 우려되긴하네요... 추가하도록 하겠습니답.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

앗.. 따로 필요 없습니다. 왜냐면 현바로 그 아래에서 catch해서 오류메시지가 있는 ErrorException으로 대체하여 throw하기 때문입니다.

@cjhih456 cjhih456 merged commit e312883 into main Jan 5, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants