From 84a1606dd0164020c5b12a56860c6845252b86e3 Mon Sep 17 00:00:00 2001 From: "Sven (AAMOS AI)" Date: Sat, 15 Aug 2026 23:20:32 +0700 Subject: [PATCH] =?UTF-8?q?feat(mobile):=20gl=C3=B6mt-l=C3=B6senord=20via?= =?UTF-8?q?=20Firebase=20+=20upprepa-l=C3=B6senord-f=C3=A4lt=20(POLISH-2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mobile/src/app/(auth)/forgot-password.tsx | 4 ++-- apps/mobile/src/app/(auth)/register.tsx | 17 ++++++++++++++++- apps/mobile/src/lib/auth-provider/firebase.ts | 4 ++++ apps/mobile/src/lib/auth-provider/types.ts | 2 ++ 4 files changed, 24 insertions(+), 3 deletions(-) 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}}