diff --git a/utils/fetchWithAuth.ts b/utils/fetchWithAuth.ts index cae3853..df1f7bd 100644 --- a/utils/fetchWithAuth.ts +++ b/utils/fetchWithAuth.ts @@ -2,6 +2,7 @@ import type { NitroFetchRequest, NitroFetchOptions } from "nitropack"; export default async (request: NitroFetchRequest, options: NitroFetchOptions = {}) => { const accessToken = useCookie("access_token").value; + const { revoke } = useAuth(); console.log("access token 2:", accessToken); let headers: HeadersInit = {}; @@ -27,7 +28,7 @@ export default async (request: NitroFetchRequest, options: NitroFetchOptions< return res; } catch (error: any) { if (error?.response?.status === 401) { - // auth.revoke(); + revoke(); } throw error; }