fix: harden production flows and user messaging

This commit is contained in:
Leon Tonhäuser committed 2026-08-11 16:07:13 +02:00
1 parent 52dce168dd
commit 86dfe8053d
43 files changed
+3520 -358

No files matched your search

+10 -1
View File
@@ -1,5 +1,6 @@
import Link from "next/link";
import { redirect } from "next/navigation";
import { headers } from "next/headers";
import { env } from "@/config/env";
import { registerEditorial } from "@/modules/auth/auth";
@@ -11,6 +12,7 @@ import {
RegistrationForm,
type RegistrationFormState,
} from "@/modules/auth/public-forms";
import { RateLimitExceededError } from "@/modules/security/rate-limit-guard";
export default function RegistrationPage() {
return (
@@ -62,8 +64,15 @@ async function registerAction(
actsForBusiness: formData.has("actsForBusiness"),
termsVersion: formData.has("termsAccepted") ? CURRENT_TERMS_VERSION : "",
privacyAcknowledged: formData.has("privacyAcknowledged"),
});
}, await headers());
} catch (error) {
if (error instanceof RateLimitExceededError) {
return {
errors: {
form: "Es wurden zu viele Registrierungsversuche gesendet. Bitte versuchen Sie es später erneut.",
},
};
}
if (error instanceof RegistrationValidationError) {
return { errors: { [error.field]: error.message } };
}