import React, { useState } from "react"; import { View, Text, TextInput, Button, StyleSheet } from "react-native"; import { signInWithEmailAndPassword, createUserWithEmailAndPassword, } from "firebase/auth"; import { doc, setDoc } from "firebase/firestore"; import { auth, db } from "../../firebase_config"; import { router } from "expo-router"; const DEFAULT_ROLE = "resp"; const LoginScreen: React.FC = () => { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const handleLogin = async () => { try { await signInWithEmailAndPassword(auth, email, password); router.replace("/(tabs)"); } catch (error: any) { alert(error.message); } }; /*const handleRegister = async () => { try { await createUserWithEmailAndPassword(auth, email, password); router.replace("/(tabs)"); } catch (error: any) { alert(error.message); } }; */ return ( Se connecter / S'incrire