@cosmicdrift/kumiko-bundled-features 0.31.1 → 0.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.31.1",
3
+ "version": "0.32.1",
4
4
  "description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -103,6 +103,31 @@ describe("LoginScreen", () => {
103
103
  expect(screen.queryByRole("link", { name: /Passwort vergessen/i })).toBeNull();
104
104
  });
105
105
 
106
+ // Bug-Bash 2026-06-07 (Bug 1): Login-Screen ist oft die einzige
107
+ // öffentliche Seite einer Admin-Domain — ohne erreichbares Impressum
108
+ // verletzt die Domain die Impressumspflicht.
109
+ test("legalLinks-prop → Impressum/Datenschutz-Links mit korrekten hrefs", () => {
110
+ renderWithProviders(
111
+ <LoginScreen
112
+ legalLinks={[
113
+ { label: "Impressum", href: "/legal/impressum" },
114
+ { label: "Datenschutz", href: "/legal/datenschutz" },
115
+ ]}
116
+ />,
117
+ );
118
+ const nav = screen.getByTestId("login-legal-links");
119
+ expect(nav).toBeTruthy();
120
+ const imprint = screen.getByRole("link", { name: "Impressum" });
121
+ expect(imprint.getAttribute("href")).toBe("/legal/impressum");
122
+ const privacy = screen.getByRole("link", { name: "Datenschutz" });
123
+ expect(privacy.getAttribute("href")).toBe("/legal/datenschutz");
124
+ });
125
+
126
+ test("ohne legalLinks → kein Legal-Footer (Opt-in der App)", () => {
127
+ renderWithProviders(<LoginScreen />);
128
+ expect(screen.queryByTestId("login-legal-links")).toBeNull();
129
+ });
130
+
106
131
  // Resend-Flow: bei email_not_verified bietet der LoginScreen einen
107
132
  // "Bestätigungs-Mail erneut senden"-Link im Fehler-Banner an.
108
133
  describe("resend verification on email_not_verified", () => {
@@ -24,6 +24,11 @@ type ResendStatus =
24
24
  | { readonly kind: "rateLimited" }
25
25
  | { readonly kind: "error" };
26
26
 
27
+ export type AuthLegalLink = {
28
+ readonly label: string;
29
+ readonly href: string;
30
+ };
31
+
27
32
  export type LoginScreenProps = {
28
33
  /** Overridet den `auth.login.title`-i18n-Key. Nur setzen wenn der
29
34
  * Titel stark app-branded ist und keine Translation braucht. */
@@ -39,6 +44,12 @@ export type LoginScreenProps = {
39
44
  * einen "Account erstellen"-Link. Apps die kein Self-Signup wollen
40
45
  * (closed-invite-only) setzen das einfach nicht. */
41
46
  readonly signupHref?: string;
47
+ /** Impressum/Datenschutz unterhalb der Card — der Login-Screen ist
48
+ * oft die einzige öffentliche Seite einer Admin-Domain und braucht
49
+ * dann selbst erreichbare Legal-Links (DE: Impressumspflicht).
50
+ * Labels kommen vom Caller (typisch schon übersetzt bzw. Eigennamen
51
+ * wie "Impressum"). */
52
+ readonly legalLinks?: readonly AuthLegalLink[];
42
53
  };
43
54
 
44
55
  // Map vom Reason-Code des Login-Handlers auf einen i18n-Key plus
@@ -78,6 +89,7 @@ export function LoginScreen({
78
89
  submitLabel,
79
90
  forgotPasswordHref,
80
91
  signupHref,
92
+ legalLinks,
81
93
  }: LoginScreenProps): ReactNode {
82
94
  const t = useTranslation();
83
95
  const { Form, Field, Input, Button, Banner } = usePrimitives();
@@ -209,6 +221,18 @@ export function LoginScreen({
209
221
  {t("auth.signup.title")}
210
222
  </a>
211
223
  )}
224
+ {legalLinks !== undefined && legalLinks.length > 0 && (
225
+ <nav
226
+ data-testid="login-legal-links"
227
+ className="flex items-center justify-center gap-3 pt-2 border-t border-border/50"
228
+ >
229
+ {legalLinks.map((link) => (
230
+ <a key={link.href} href={link.href} className={`${authMutedLinkClass} text-xs`}>
231
+ {link.label}
232
+ </a>
233
+ ))}
234
+ </nav>
235
+ )}
212
236
  </div>
213
237
  </AuthCard>
214
238
  );