fix: 로그인이 만료된 채로 들어오면 로그인 창이 저절로 떠 화면이 막히던 문제 — 로그인 창은 사람이 한 동작(GET 아닌 요청)의 401에만
This commit is contained in:
1 parent
dff03f6b28
commit
bfbf6da101
1 file changed
+2
-2
@@ -58,8 +58,8 @@ async function authFetch(input: RequestInfo | URL, init?: RequestInit): Promise<
|
||||
const anonymous = await fetch(withToken(retry, null))
|
||||
if (anonymous.status !== 401) return anonymous
|
||||
}
|
||||
// 로그아웃하다 만료된 거면 로그인 창을 띄우지 않는다
|
||||
if (new URL(request.url).pathname !== '/v1/auth/logout') emitAuthRequired()
|
||||
// 로그인 창은 사람이 한 동작(글쓰기·댓글 등)에만 띄운다. 화면이 알아서 받는 GET(내 정보 등)이나 로그아웃이 만료로 401이면 조용히 로그아웃 상태로 둔다
|
||||
if (request.method !== 'GET' && new URL(request.url).pathname !== '/v1/auth/logout') emitAuthRequired()
|
||||
return response
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user