feat: add editorial registration and authentication

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 20:48:43 +02:00
1 parent 7acaacb92e
commit 9b22752ef2
20 files changed
+1728 -20

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { expect, test } from "vitest";
import { auth } from "./auth";
test("rejects direct Better Auth sign-up requests that bypass B2B registration", async () => {
const response = await auth.handler(
new Request("http://localhost:3000/api/auth/sign-up/email", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
email: "bypass@example.com",
name: "Bypass",
password: "sicheres-passwort-123",
}),
}),
);
expect(response.status).toBe(403);
});