upd: login
Deskripsi: - login token - logout No Issues
This commit is contained in:
@@ -4,10 +4,22 @@ import HeaderRightDivisionList from "@/components/division/headerDivisionList";
|
||||
import HeaderMemberList from "@/components/member/headerMemberList";
|
||||
import HeaderRightProjectList from "@/components/project/headerProjectList";
|
||||
import { Headers } from "@/constants/Headers";
|
||||
import { router, Stack } from "expo-router";
|
||||
import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { Redirect, router, Stack } from "expo-router";
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import { Text } from "react-native";
|
||||
|
||||
export default function RootLayout() {
|
||||
const { token, isLoading } = useAuthSession()
|
||||
|
||||
if (isLoading) {
|
||||
return <Text>Loading...</Text>;
|
||||
}
|
||||
|
||||
if (!token?.current) {
|
||||
return <Redirect href="/" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack screenOptions={Headers.shadow}>
|
||||
|
||||
Reference in New Issue
Block a user