fix(388-1 보안): 로그아웃 물음 — 주소 먼저 옮긴 뒤 떠남 확인

- B05 · B06 물음이 아직 같은 페이지로 보고 안 물어 초안 있는 채 바로 로그아웃되던 것
- 라우터처럼 주소를 홈으로 옮긴 뒤 물음 · [취소]면 주소 되돌림
- 화면: 초안 있는 채 로그아웃 → 확인창 · [취소] 머묾 · [폐기] 지움 · 밝음/어두움

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
2026-10-17 17:44:10 +09:00
co-authored by Claude Opus 5.5
parent 1eb9c0f0b7
commit c9cafa6136
2 changed files with 10 additions and 4 deletions
+7 -2
View File
@@ -51,8 +51,14 @@ function onApp_Lang_Toggle_Click(): void {
/** 로그아웃(388-1) — 떠남 확인 먼저 → 서버 로그아웃 → 이 브라우저 자료 지움 → 홈으로 새로고침. */
async function onApp_Logout_Click(): Promise<void> {
// 물음은 라우터처럼 주소가 먼저 옮겨진 뒤 — 안 그러면 B05 · B06 물음이 「같은 페이지」로 보고 안 물음
const back = window.location.hash;
history.replaceState(null, "", `#/${ROUTES.A01_HOME}`); // hashchange 없이
const guard = takeLeaveGuard();
if (guard && !(await guard())) return; // [취소] — 머묾
if (guard && !(await guard())) {
history.replaceState(null, "", back); // [취소] — 머묾 · 주소 되돌림
return;
}
setLeaveGuard(null);
const { logout } = await import("../A06_Login/A06_Login_Api_Fetch");
try {
@@ -62,7 +68,6 @@ async function onApp_Logout_Click(): Promise<void> {
}
const { wipeAccountCache } = await import("./b_project_switch");
await wipeAccountCache();
history.replaceState(null, "", `#/${ROUTES.A01_HOME}`); // hashchange 없이 — 바로 새로고침
window.location.reload();
}
+3 -2
View File
@@ -65,8 +65,9 @@ def test_로그아웃_길_차례():
body = shell[shell.index("async function onApp_Logout_Click") :]
body = body[: body.index("\n}\n")]
order = [
body.index(s) for s in ("takeLeaveGuard()", "logout()", "wipeAccountCache()", "reload()")
]
body.index(s)
for s in ("replaceState(", "takeLeaveGuard()", "logout()", "wipeAccountCache()", "reload()")
] # 주소 먼저 옮김 — B05 · B06 물음이 「같은 페이지」로 보고 안 묻는 일 막음
assert order == sorted(order)
login = (ROOT / "A06_Login/A06_Login_Api_Fetch.ts").read_text(encoding="utf-8")
assert "wipeIfOwnerChanged(data.user.id)" in login