Reimplemented outdated code, added encryption keys for each room, added support for profile images, added friend requests via url/qr-code

This commit is contained in:
pascalyazid committed 2026-05-11 21:35:28 +02:00
1 parent 508f17315e
commit 32e4bf8b32
58 files changed
+3270 -362

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
"use server";
import { signup } from "@/utils/authentication/register";
export type RegisterState = {
error?: string;
} | null;
export async function registerAction(
_prevState: RegisterState,
formData: FormData,
): Promise<RegisterState> {
const email = formData.get("email");
const password = formData.get("password");
if (typeof email !== "string" || typeof password !== "string") {
return { error: "Email and password are required." };
}
try {
const result = await signup(email, password);
if (result?.error) {
return { error: result.error.message ?? "Registration failed." };
}
} catch (error) {
const message = error instanceof Error ? error.message : "Registration failed.";
return { error: message };
}
return null;
}