Files
Aislo/.agent/complete_and_old/plan_register_split_COMPLETED.md
T

4.1 KiB

회원가입 플로우 개편: 완료된 항목들

마지막 업데이트: 2026-07-08 상태: 회원가입 축소, 세션 쿠키 인증, 로그인 후 B01 리다이렉트 완료


완료된 구현 항목

1. DB 변경

  • db_management/003_register_split.sql 생성
    • users.status ENUM에 'NO_COMPANY' 추가
    • 회원가입 시 회사 정보 NULL로 시작하도록 변경

2. 백엔드 변경 (A07_Register, A06_Login)

  • A07_Register_Schema.py 수정

    • RegisterRequest 필드: email, password, password_confirm, name, position, phone, terms_agreed, privacy_agreed, marketing_agreed, terms_version
    • 회사 관련 필드 전부 제거
    • password_confirm 검증 추가
  • common_util_auth_repository.py 수정

    • create_registration(): 회사/join_request 생성 로직 제거, users INSERT만 수행
    • complete_registration(): 무조건 status = 'NO_COMPANY'로 변경
  • A07_Register_Router.py 수정

    • request_registration(): password_confirm 제외 처리
  • A06_Login_Router.py 수정

    • request_login(): status not in ("ACTIVE", "NO_COMPANY") 체크로 변경
    • current_session(): 응답에 company_id, is_master 추가
  • common_util_auth.py 수정

    • require_company() dependency 추가
  • main.py 수정

    • B03~B06 라우터에 require_company 의존성 추가
  • config_db.py 수정

    • autocommit=True 설정 (pooled 커넥션 트랜잭션 스냅샷 이슈 해결)

3. 리소스 파일

  • resources/legal/terms_of_service.txt 생성
  • resources/legal/privacy_policy.txt 생성
  • resources/legal/marketing_consent.txt 생성

4. 프론트엔드 변경 (A07_Register, A06_Login, Router)

  • A07_Register_Api_Fetch.ts 수정

    • RegisterPayload 필드 축소
  • A07_Register_UI_Auth_Page.ts 전면 재작성

    • 필드: name, position, email, phone, password, passwordConfirm, terms/privacy/marketing (아코디언)
    • 약관 텍스트 파일 로드 기능
    • OTP 입력 창 기존 로직 유지
  • A00_Common/router.ts 수정

    • B02~B11 라우트: company_id 없으면 B01로 리다이렉트
  • ui_template_locale.ts 수정

    • A07_Register_Field_Position, A07_Register_Field_Phone, A07_Register_Field_PasswordConfirm
    • A07_Register_Error_PasswordMismatch 추가
  • A07_Register_UI_Style.css 수정

    • .a07-register__agreement 아코디언 스타일 추가
  • A06_Login_Api_Fetch.ts 수정

    • SessionUser 인터페이스에 company_id, is_master 추가
    • fetchSessionUser() 구현 (세션 조회 → company_id 확인용)
  • A00_Common/app_shell.ts 수정

    • 로그아웃 시 /auth/logout API 호출 (서버 세션 삭제)
  • B03~B06 API Fetch 파일 수정

    • Bearer 토큰 제거, credentials: "include" 추가 (세션 쿠키 기반)
    • B03_FileInput_Api_Fetch.ts, B04_wf1_Surface_Api_Fetch.ts, B05_wf2_Route_Api_Fetch.ts, B06_wf3_ProfileCross_Api_Fetch.ts
  • 구식 파일 삭제

    • A06_Login_UI_Page.ts (localStorage 기반 구식 로그인 UI)

검증 항목 (사용자 확인됨)

1차 검증: 가입 및 이메일 인증

  • 회원가입 폼 필드 축소 확인
  • 약관 아코디언 펼쳐서 내용 표시 확인
  • OTP 입력 칸 노출 확인
  • 이메일 인증 완료 후 로그인 페이지 리다이렉트 확인

2차 검증: DB 상태 확인

  • users.status = 'NO_COMPANY'
  • company_id = NULL
  • role = 'MEMBER'
  • is_master = FALSE

3차 검증: 로그인 및 상태

  • NO_COMPANY 상태에서도 로그인 성공 (기존: status != ACTIVE로 실패)

4차 검증: 회사 없이 B02+ 접근 차단

  • B02~B11 진입 시 B01로 리다이렉트 동작 확인
  • 백엔드 require_company 에러 발생

최종 상태

🟢 회원가입 플로우 개편 완료 (AD 단계 중 AC 완료)

  • DB 마이그레이션
  • 백엔드 로직 수정
  • 프론트엔드 UI/라우팅
  • 세션 쿠키 기반 인증 통일
  • localStorage 토큰 완전 제거
  • 회사 연결 필수화 (라우팅 가드)

🟡 B01_AccountDetail 팝업 기능은 별도 작업 (D 단계 — 다음 세션)