fix: 보안 강화, 리프레시 토큰 도입, 연계 오류 수정

- api/client: 리프레시 토큰 자동 갱신 (401 시 재시도, 동시 요청 dedup)
- api/client: 204 No Content 처리 추가 (res.json() 크래시 방지)
- api/client: 서버 에러 메시지 body에서 파싱하여 전달
- api/auth: logout 함수 추가 (서버 세션 삭제), 미사용 refreshToken 함수 제거
- AuthContext: 로그인 시 refreshToken 저장, 로그아웃 시 서버 호출 분리
- AuthContext: 401 이벤트는 로컬 세션만 정리 (clearSession 분리)
- DownloadSection: 게임 시작 토큰을 localStorage에서 직접 읽기 (스테일 방지)
- DownloadAdmin: XHR 401 처리, Content-Type 헤더 추가
- AnnouncementAdmin: 등록/수정/삭제 에러 상태 표시 추가
- AnnouncementBoard: API 실패 시 에러 메시지 표시
- UserAdmin: 권한 변경/삭제 에러 처리 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 09:51:35 +09:00
parent f85e261366
commit 6fb7e2cbc5
8 changed files with 143 additions and 26 deletions

View File

@@ -22,7 +22,10 @@ export default function DownloadSection() {
return;
}
window.location.href = 'a301://launch?token=' + user.token;
// user.token은 로그인 시점 값으로 만료됐을 수 있으므로
// tryRefresh가 갱신한 최신 토큰을 localStorage에서 직접 읽음
const token = localStorage.getItem('token');
window.location.href = 'a301://launch?token=' + token;
};
const handleDownloadLauncher = () => {