Skip to content

Commit e1e6982

Browse files
authored
Merge pull request #38 from Nexters/fix/session-storage-key-delete
fix: 토큰 만료 시 토큰 키값 삭제
2 parents 296c9d0 + fded2ab commit e1e6982

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

apps/tuk-web/src/shared/lib/api/auth/refreshManager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const state: RefreshState = {
1313
export function requestTokenRefresh(trigger: () => void, timeoutMs?: number) {
1414
if (state.refreshing && state.promise) return state.promise;
1515

16+
sessionStorage.removeItem('accessToken');
17+
1618
state.refreshing = true;
1719
trigger();
1820

apps/tuk-web/src/shared/lib/api/rest/rest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ export class RestAPI implements RestAPIProtocol {
138138
const res = await this.instance.request(fullUrl, reqInit);
139139
if (!res.ok) {
140140
if (res.status === 401) {
141+
sessionStorage.removeItem('accessToken');
142+
141143
const bridge = this.instance.getBridgeSend();
142144
if (bridge) {
143145
try {

0 commit comments

Comments
 (0)