Skip to content

로그인, 로그아웃 구현#2

Open
jun-ha wants to merge 5 commits intodevfrom
feat/auth
Open

로그인, 로그아웃 구현#2
jun-ha wants to merge 5 commits intodevfrom
feat/auth

Conversation

@jun-ha
Copy link
Owner

@jun-ha jun-ha commented Jan 3, 2025

  • 코드 리팩토링

    • 불필요한 유스케이스 인터페이스 삭제
    • RegisterService -> UserService : UserService에서 유저 관련 기능 처리하도록 통합
    • RegisterController -> UserController : UserController에서 유저 관련 요청 처리하도록 통합
  • 로그인, 로그아웃 구현

    • 레디스에 세션 저장
    • 로그인 시 쿠키에 세션 아이디를 저장
    • 로그아웃 시 레디스에 세션 삭제

jun-ha added 5 commits January 4, 2025 07:18
- 애플리케이션의 에러 코드를 갖는 CustomException 정의
- 모든 애플리케이션 예외가 CustomException을 상속
- ExceptionHandler에서 동일하게 처리
- 불필요한 유스케이스 인터페이스 삭제
- 회원가입, 로그인, 로그아웃을 처리하는 UserService로 통합
- 로그인은 레디스에 세션 저장 및 생성된 세션아이디 반환
- 로그아웃은 세션 삭제 처리
Copy link

@highluck highluck left a comment

Choose a reason for hiding this comment

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

해당 PR은 좋은데
시간 되신다면

oauth 2.0 개념을 활용해서
access token 과 refresh token 개념을 도입해봐도 좋을것 같아요!
https://hudi.blog/oauth-2.0/


import java.io.Serializable;

@Getter @Setter
Copy link

Choose a reason for hiding this comment

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

생성자가 있어서 setter는 빼도 되지않을까해요!

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