Skip to content

feat: Phase 4 - authentication - #7

Merged
areumz merged 1 commit into
mainfrom
feature/auth
Aug 29, 2026
Merged

areumz merged 1 commit into
mainfrom
feature/auth

Conversation

@areumz

@areumz areumz commented Aug 29, 2026 •

Copy link
Copy Markdown
Owner

Phase 4 — 인증 (회원가입/로그인/세션/소유권)

세션 기반 인증을 구현하고, Article에 소유자 개념 추가

완료한 작업

  • spring-security-crypto 의존성 추가 (Security 스타터 전체 미사용)
  • PasswordEncoder Bean 등록 (BCryptPasswordEncoder)
  • User 도메인 + UserRepository(memory) + 순수 JUnit 테스트
  • 회원가입 (아이디 중복 체크, BCrypt 암호화)
  • 로그인 (passwordEncoder.matches()로 검증, 세션 저장)
  • 로그아웃 (session.invalidate())
  • LoginCheckInterceptor + WebConfig로 인증 검사 (로그인/회원가입 경로 제외 처리)
  • @Valid + BindingResult로 회원가입 폼 검증, 에러 메시지 표시
  • 로그인 실패 시 에러 메시지 처리
  • Article에 userId 연결, 등록 시 로그인 사용자 id 세팅
  • 리스트/상세를 로그인 사용자 소유 것만 보이도록 필터링
  • 타 사용자 리소스 직접 URL 접근 시 예외 처리

학습 개념

HttpSession, PasswordEncoder Bean 등록, BCrypt encode/matches, HandlerInterceptor+WebMvcConfigurer, @Valid+BindingResult, DTO(폼 객체), Thymeleaf th:field/th:object

검증 방법

  • 계정 두 개로 각각 가입 후 로그인 시 서로 다른 리스트가 보임을 직접 확인 (US-6)
  • 로그아웃 상태에서 /articles 접근 시 /login으로 리다이렉트 확인
  • 타 계정의 Article id로 직접 URL 접근 시 접근 차단 확인

완료 기준 (DoD)

  • 로그아웃 상태로 보호된 페이지 접근 시 로그인 화면으로 리다이렉트됨
  • 계정 두 개로 가입 후 각각 로그인 시 서로 다른 리스트가 보임
  • 로그인/회원가입 페이지 자체는 인터셉트되지 않음
  • 비밀번호가 BCrypt 해시로 저장됨을 직접 확인

참고

  • 계획 문서: rpi/article-vocab-tracker/plan/PLAN.md (Phase 4)

@areumz
areumz merged commit e972ebf into main Aug 29, 2026
1 check 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.

1 participant