From 4f7613a27ab89a542a289dbd1d0c1d3f98fa86be Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 7 Jul 2023 00:36:17 +0800 Subject: [PATCH] Clear stored tokens if they are invalid --- src/routes/Revalidation/Revalidation.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/Revalidation/Revalidation.tsx b/src/routes/Revalidation/Revalidation.tsx index defd9fe..e2f099e 100644 --- a/src/routes/Revalidation/Revalidation.tsx +++ b/src/routes/Revalidation/Revalidation.tsx @@ -14,6 +14,7 @@ import { import AnimatedContainer from "../../components/AnimatedContainer/AnimatedContainer"; import { setUser } from "../../features/redux/slices/UserSlice/UserSlice"; import { setOnboarding } from "../../features/redux/slices/StatusSlice/StatusSlice"; +import AsyncStorage from "@react-native-async-storage/async-storage"; export default function Revalidation() { const dispatch = useDispatch(); @@ -46,6 +47,7 @@ export default function Revalidation() { } else { await setState("Session expired"); await setTimeout(() => { + AsyncStorage.clear(); navigation.navigate("Login"); }, 700); }