diff --git a/apps/mobile/src/app/(auth)/forgot-password.tsx b/apps/mobile/src/app/(auth)/forgot-password.tsx index 6c9f48f..7a78896 100644 --- a/apps/mobile/src/app/(auth)/forgot-password.tsx +++ b/apps/mobile/src/app/(auth)/forgot-password.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { Text } from "react-native"; import { Link } from "expo-router"; -import { api } from "@/lib/api"; +import { firebaseAuthProvider } from "@/lib/auth-provider/firebase"; import { t } from "@/lib/i18n"; import { Body, Button, Input, Screen, Spacer, Title } from "@/components/ui"; import { colors, spacing } from "@/lib/theme"; @@ -21,7 +21,7 @@ export default function ForgotPasswordScreen() { setBusy(true); setError(null); try { - await api("/v1/auth/forgot-password", { method: "POST", body: { email } }); + await firebaseAuthProvider.sendPasswordReset(email.trim()).catch(() => {}); setSent(true); } catch (err) { setError(err instanceof Error ? err.message : t("common.error")); diff --git a/apps/mobile/src/app/(auth)/register.tsx b/apps/mobile/src/app/(auth)/register.tsx index d1a1082..2755bdf 100644 --- a/apps/mobile/src/app/(auth)/register.tsx +++ b/apps/mobile/src/app/(auth)/register.tsx @@ -22,10 +22,19 @@ export default function RegisterScreen() { const [displayName, setDisplayName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [confirmPassword, setConfirmPassword] = useState(""); const [error, setError] = useState(null); const [busy, setBusy] = useState(false); const submit = async () => { + if (password.length < 8) { + setError("Lösenordet måste vara minst 8 tecken."); + return; + } + if (password !== confirmPassword) { + setError("Lösenorden matchar inte."); + return; + } setBusy(true); setError(null); try { @@ -97,11 +106,17 @@ export default function RegisterScreen() { onChangeText={setEmail} /> + {error && {error}}