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

#버그수정 #기능개선: User API, Logout API #37

Merged
merged 5 commits into from
Apr 24, 2023

Conversation

cho4036
Copy link
Contributor

@cho4036 cho4036 commented Apr 20, 2023

버그 수정

  • 기존: Admin 권한이 없는 일반 User의 경우, Logout 요청시 403 Error 발생
  • 변경: 일반 User도 Logout 요청 가능

기능 수정 1

  • User당 여러개의 session을 가짐
  • 기존: User ID에 대한 모든 session을 만료 처리
  • 변경: 해당 Session에 대해서만 만료 처리

기능 수정 2

  • 기존: UserUpdate 기능에서 role 변경 가능
  • 변경: Role 변경 불가능

기능추가

  • Admin용 UserUpdate 기능
  • Admin용 UserUpdate에서 role 변경 가능

@cho4036 cho4036 requested a review from ktkfree April 20, 2023 04:33
@cho4036 cho4036 changed the title #버그수정 #기능개선: Logout 기능 #버그수정 #기능개선: User API, Logout API Apr 20, 2023
return
}
userInfo, ok := request.UserFrom(ctx)
if !ok {
ErrorJSON(w, httpErrors.NewBadRequestError(fmt.Errorf("user not found")))
log.Errorf("user info is not found")
ErrorJSON(w, httpErrors.NewInternalServerError(httpErrors.InternalServerError))
Copy link
Contributor

Choose a reason for hiding this comment

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

아무 에러 메시지 없이 internal server error status 만 반환하는게 의도된 건가요?
error message 와 함께 500 에러를 발생하기 위해서는 아래의 방법을 사용하는것이 좋겠습니다.
. fmt.Errorf("에러메시지") - 일반 에러는 error message 와 500 internal server error 를 발생함
. httpErrors.NewInternalServerError(fmt.Sprintf("메시지") )

@ktkfree ktkfree merged commit 4a8182d into openinfradev:develop Apr 24, 2023
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