From a4b98ba58a76dcc8613dc322f2fee509cdd91621 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Wed, 7 May 2025 19:39:22 +0200 Subject: [PATCH] feat: re-added automatic revoke --- utils/fetchWithAuth.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }