From 4302c3c20171edd3ae193dcba18152dc0e79beb2 Mon Sep 17 00:00:00 2001 From: Michael DeMarco Date: Sun, 7 Jan 2024 23:44:29 -0800 Subject: [PATCH] fix: disable sessions, for now --- client/src/components/Form.tsx | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/client/src/components/Form.tsx b/client/src/components/Form.tsx index ea15bca..01f9423 100644 --- a/client/src/components/Form.tsx +++ b/client/src/components/Form.tsx @@ -93,34 +93,34 @@ const Form: React.FC = () => { } showErrorToast(errorMessage); - localStorage.removeItem("session"); + // localStorage.removeItem("session"); setStage("phoneInput"); } }, [error]); const handlePhoneSubmit = async () => { - const session = localStorage.getItem("session"); - let sessionData: Session | null = session ? JSON.parse(session) : null; + // const session = localStorage.getItem("session"); + // let sessionData: Session | null = session ? JSON.parse(session) : null; - if ( - sessionData && - sessionData.countryCode === countryCode && - sessionData.phoneNumber === phoneNumber - ) { - setCountryCode(sessionData.countryCode); - setPhoneNumber(sessionData.phoneNumber); - setOtpSession(sessionData.otpSession); + // if ( + // sessionData && + // sessionData.countryCode === countryCode && + // sessionData.phoneNumber === phoneNumber + // ) { + // setCountryCode(sessionData.countryCode); + // setPhoneNumber(sessionData.phoneNumber); + // setOtpSession(sessionData.otpSession); - setToken(sessionData.token); - setBerealToken(sessionData.berealToken); + // setToken(sessionData.token); + // setBerealToken(sessionData.berealToken); - setStage("settings"); + // setStage("settings"); - return; - } + // return; + // } try { - localStorage.removeItem("session"); + // localStorage.removeItem("session"); const response = await axios.post(`${BASE_URL}/request-otp`, { phone: `${countryCode}${phoneNumber}`, @@ -144,15 +144,15 @@ const Form: React.FC = () => { setToken(response.data?.token); setBerealToken(response.data?.bereal_token); - const sessionData: Session = { - countryCode, - phoneNumber, - token: response.data?.token, - berealToken: response.data?.berealToken, - otpSession, - }; + // const sessionData: Session = { + // countryCode, + // phoneNumber, + // token: response.data?.token, + // berealToken: response.data?.berealToken, + // otpSession, + // }; - localStorage.setItem("session", JSON.stringify(sessionData)); + // localStorage.setItem("session", JSON.stringify(sessionData)); setStage("settings"); } catch (error) {