Ok it might work
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { useState } from "react";
|
||||
import { View, Text, TextInput, TouchableOpacity, StyleSheet } from "react-native";
|
||||
import { useAuth } from "@/context/auth-context";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function AuthScreen() {
|
||||
const [isLogin, setIsLogin] = useState(true);
|
||||
@@ -17,9 +18,12 @@ function LoginScreen({ onSwitch }) {
|
||||
const [password, setPassword] = useState("");
|
||||
const { login } = useAuth();
|
||||
|
||||
const handleLogin = () => {
|
||||
console.log("Login ->", { email, password });
|
||||
login(email, password);
|
||||
const handleLogin = async () => {
|
||||
const loginResult = await login(email, password);
|
||||
if (loginResult) {
|
||||
console.log("Login successful");
|
||||
router.replace("/(tabs)");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user