Moved from axios to Fetch API, Added user object to the AuthState
This commit is contained in:
@ -3,11 +3,13 @@ import { Text, View } from "react-native";
|
||||
import { useAuth } from "../context/AuthContext";
|
||||
|
||||
export default function Index() {
|
||||
const { onLogout } = useAuth();
|
||||
const user = "debil"
|
||||
const { onLogout, authState } = useAuth();
|
||||
|
||||
const user = authState.user;
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
|
||||
<Text>Welcome {user}</Text>
|
||||
<Text>Welcome {user.username}</Text>
|
||||
<Text
|
||||
onPress={() => {
|
||||
// The `app/(app)/_layout.tsx` will redirect to the sign-in screen.
|
||||
|
Reference in New Issue
Block a user