sequenceDiagram
autonumber
participant Client as 클라이언트(브라우저)
participant API as 백엔드 API 서버
participant DB as 데이터베이스
rect rgba(200, 255, 255, 0.1)
Note over Client, DB: 계정 정보 수정 프로세스
Client->>Client: 계정 정보 수정 폼 작성<br>(이름 또는 비밀번호)
Client->>API: 계정 정보 수정 요청<br>(변경할 정보, 현재 비밀번호, JWT 토큰)
API->>API: JWT 토큰 검증
alt 토큰 유효
API->>DB: 현재 비밀번호 확인<br>(Users 테이블)
DB-->>API: 저장된 password_hash 반환
API->>API: 현재 비밀번호 검증
alt 비밀번호 일치
API->>API: 새 정보 유효성 검증
alt 새 비밀번호 변경 요청 포함
API->>API: 새 비밀번호 해싱
end
API->>DB: Users 테이블 업데이트<br>(name, password_hash(선택적), updated_at)
DB-->>API: 업데이트 결과
API-->>Client: 200 OK<br>(수정 성공 메시지)
Client->>Client: 성공 알림 표시
Client->>Client: 업데이트된 정보 표시
else 비밀번호 불일치
API-->>Client: 403 Forbidden<br>(현재 비밀번호 불일치)
Client->>Client: 오류 메시지 표시
end
else 토큰 무효
API-->>Client: 401 Unauthorized
Client->>Client: 로그인 페이지로 리다이렉트
end
end
Created
April 18, 2025 15:41
-
-
Save Mineru98/4a0b7183014f5ebfa0e85d22bb8deafa to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment