Ok it might work

This commit is contained in:
2026-04-25 12:08:14 +02:00
parent 928db54b3e
commit 858ee5e28b
10 changed files with 229 additions and 67 deletions

View File

@@ -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 (