mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Clear stored tokens if they are invalid
This commit is contained in:
parent
3f40140577
commit
4f7613a27a
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue