Reapply "Add missing admin action files and navigation links"

This reverts commit 4d515bc400.
This commit is contained in:
Simo committed 2026-07-11 20:52:56 +02:00
1 parent 96ed768f14
commit 5b4228261a
338 files changed
+28143 -5948

No files matched your search

+8 -5
View File
@@ -32,7 +32,9 @@ const DEFAULT_LOOK = "hr-100-.hd-180-1.ch-255-66.lg-280-110.sh-305-62";
export async function register(prevState: string | null, formData: FormData): Promise<string | null> {
const raw = {
username: String(formData.get("username") ?? "").trim(),
mail: String(formData.get("mail") ?? "").trim().toLowerCase(),
mail: String(formData.get("mail") ?? "")
.trim()
.toLowerCase(),
password: String(formData.get("password") ?? ""),
look: String(formData.get("look") ?? "").trim() || DEFAULT_LOOK,
};
@@ -61,8 +63,9 @@ export async function register(prevState: string | null, formData: FormData): Pr
// VPN/proxy block (only when enabled in /admin/vpn).
if ((await checkVpn(ip)).blocked) {
return (
await siteSettings.get("vpn_block_message", "")
) || "Registrations from VPN/proxy connections are not allowed.";
(await siteSettings.get("vpn_block_message", "")) ||
"Registrations from VPN/proxy connections are not allowed."
);
}
// Max accounts per IP (0 / unset = unlimited), mirrors AtomCMS.
@@ -85,7 +88,7 @@ export async function register(prevState: string | null, formData: FormData): Pr
const now = Math.floor(Date.now() / 1000);
try {
const created = await prisma.user.create({
await prisma.user.create({
data: {
username,
password: await hashPassword(password),
@@ -100,7 +103,7 @@ export async function register(prevState: string | null, formData: FormData): Pr
if (hasEmail) {
try {
await sendVerification(created.id, mail);
await sendVerification(mail);
} catch {
// No-op: account is created; user can request a new link later.
}