Skip to content

feat: 세션기반 회원가입, 로그인, 로그아웃 구현#4

Open
wjddydghks wants to merge 1 commit intodevelopfrom
feat/#3-member-auth
Open

feat: 세션기반 회원가입, 로그인, 로그아웃 구현#4
wjddydghks wants to merge 1 commit intodevelopfrom
feat/#3-member-auth

Conversation

@wjddydghks
Copy link
Copy Markdown

관련 이슈

Closes #3

작업 내용

회원가입

  • Member 엔티티 생성
  • BaseEntity 상속으로 createdAt, updatedAt, deletedAt 자동 관리
  • Role Enum 분리 (USER, ADMIN)
  • Member.create() 팩토리 메서드로 생성 시 기본 Role.USER 부여
  • 비밀번호 BCrypt 암호화 저장

로그인

  • MemberDetailService - UserDetailsService 구현체
  • AuthenticationManager로 인증 처리
  • 인증 성공 시 세션 생성 → Redis 저장
  • 클라이언트에 SESSION 쿠키 반환

로그아웃

  • Security logoutUrl 설정으로 처리
  • 세션 삭제 + SESSION 쿠키 삭제
  • logoutSuccessHandler로 200 응답 반환

테스트

  • [o] 회원가입 성공
  • [o] 로그인 성공
  • [o] 로그아웃 성공 후 세션 삭제 확인

.sessionManagement(session -> session
.maximumSessions(1)
.maxSessionsPreventsLogin(false)
);;;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

세미콜론 3개 오타입니다 ;;;; 하나로 수정 부탁드립니다

import java.util.Optional;

@Repository
public interface MemberRepository extends JpaRepository<Member, Long> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

단건 조회인데 findAllByMemberName은 어색합니다. findByMemberName으로 변경 부탁드립니다

Copy link
Copy Markdown
Collaborator

@gkdmsgus gkdmsgus left a comment

Choose a reason for hiding this comment

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

LGTM, 세미콜론 오타랑 findAll 네이밍만 수정 부탁드립니다

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.

3 participants