Skip to content

Commit

Permalink
Fix/#445 preCheckAccessToken 로직 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ukkodeveloper committed Sep 27, 2023
1 parent d4b8a20 commit 6f4e921
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions frontend/src/shared/remotes/preCheckAccessToken.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import AuthError from '@/shared/remotes/AuthError';
import accessTokenStorage from '@/shared/utils/accessTokenStorage';
import type { ErrorResponse } from '@/shared/remotes/index';

const isTokenExpiredAfter60seconds = (tokenExp: number) => {
return tokenExp * 1000 - 30 * 1000 < Date.now();
Expand Down Expand Up @@ -31,13 +29,7 @@ const preCheckAccessToken = async () => {
accessTokenStorage.setToken(accessToken);
return accessToken;
}

const errorResponse: ErrorResponse = await response.json();

if (response.status === 401) {
throw new AuthError(errorResponse);
}
// 기타 상태코드 처리
accessTokenStorage.removeToken();
}

return null;
Expand Down

0 comments on commit 6f4e921

Please sign in to comment.