From 62dad94d5d771747d7f75001362b3595c1eba64e Mon Sep 17 00:00:00 2001 From: wixarm Date: Sun, 1 Feb 2026 15:09:31 +0330 Subject: [PATCH] fix: tokn timeout redirect --- src/partials/auth/Login.tsx | 8 +------- src/utils/axios.ts | 5 +++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/partials/auth/Login.tsx b/src/partials/auth/Login.tsx index 960f53c..1ee4232 100644 --- a/src/partials/auth/Login.tsx +++ b/src/partials/auth/Login.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, { useState } from "react"; import { motion, Variants } from "framer-motion"; import { useNavigate } from "@tanstack/react-router"; import { useApiMutation } from "../../utils/useApiRequest"; @@ -52,12 +52,6 @@ const Login: React.FC = () => { disableBackdrop: false, }); - useEffect(() => { - if (phoneNumber && phoneNumber.length >= 10) { - handleGetCaptcha(); - } - }, [phoneNumber]); - const handleGetCaptcha = async () => { try { const data = await mutationCaptcha.mutateAsync({ diff --git a/src/utils/axios.ts b/src/utils/axios.ts index 2131a62..bad9fbd 100644 --- a/src/utils/axios.ts +++ b/src/utils/axios.ts @@ -33,7 +33,7 @@ api.interceptors.request.use( return config; }, - (error) => Promise.reject(error) + (error) => Promise.reject(error), ); api.interceptors.response.use( @@ -50,12 +50,13 @@ api.interceptors.response.use( rtl: true, }); if (typeof logOut === "function") { + window.location.href = "/"; logOut(); } } } return Promise.reject(error); - } + }, ); export default api;