diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 424e10a..1e329cf 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -19,11 +19,13 @@ import ReCAPTCHA from "react-google-recaptcha"; export default function Login() { // eslint-disable-next-line no-restricted-globals const queryParams = new URLSearchParams(location?.search); - const sessionExpired = queryParams.get("sessionExpired"); + // const sessionExpired = queryParams.get("sessionExpired"); const dispatch = useDispatch(); const { state } = useLocation(); + const [sessionExpired, setSessionExpired] = useState(queryParams.get("sessionExpired")) + const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA let [loginType, setLoginType] = useState(""); @@ -235,6 +237,20 @@ export default function Login() { setPassword(""); }, [loginType]); + + // EFFECT TO CLEAR SESSION EXPIRY IF IT EXISTS AFTER SOME SECONDS + useEffect(()=>{ + let timer; + if(sessionExpired == "true"){ + timer = setTimeout(()=>{ + setSessionExpired(false) + },5000) + } + return () => { + clearTimeout(timer) + } + }, []) + return ( <>