mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
로그인 구현
This commit is contained in:
1 parent
b6fbd83d6f
commit
bd1cc9ea38
6 files changed
+44
-7
No files matched your search
@@ -35,13 +35,13 @@ const callAPIInternal = async (
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
if (res.status === 401 && retryIfUnauthorized) {
|
||||
if (res.status === 401 && retryIfUnauthorized && token !== undefined) {
|
||||
return await callAPIInternal(input, init, null, false);
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
export const callAPI = async (input: RequestInfo, init?: RequestInit, token?: string | null) => {
|
||||
export default async (input: RequestInfo, init?: RequestInit, token?: string | null) => {
|
||||
return await callAPIInternal(input, init, token);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export { default as callAPI } from "./callAPI";
|
||||
Reference in new issue
Block a user