From 2ee6481595259efb89fd517b58b97a09421a4eba Mon Sep 17 00:00:00 2001 From: Rushikesh-Sonawane99 Date: Thu, 7 Nov 2024 11:26:44 +0530 Subject: [PATCH] Issue #PS-000 chore: Fixed login issue due to undefine token --- src/services/Interceptor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/Interceptor.ts b/src/services/Interceptor.ts index 4dddcfe7..75162e21 100644 --- a/src/services/Interceptor.ts +++ b/src/services/Interceptor.ts @@ -27,7 +27,7 @@ instance.interceptors.request.use( (config) => { if (typeof window !== "undefined" && window.localStorage) { const token = localStorage.getItem("token"); - if (token) { + if (token && config.url && !config.url.endsWith("user/v1/auth/login")) { config.headers.Authorization = `Bearer ${token}`; } const academicYearId = localStorage.getItem('academicYearId')