feat: add local auth billing and usage management

This commit is contained in:
inman committed 2026-08-12 12:13:06 +08:00
1 parent f642b5e71f
commit 196fdde83f
119 files changed
+15695 -2650

No files matched your search

+10 -5
View File
@@ -12,15 +12,20 @@ describe("AuthLoginPanel", () => {
expect(source).not.toContain("randomStr");
});
it("supports switching between normal and admin login pages", async () => {
it("uses one platform phone/password login for every role", async () => {
const panelSource = await readFile(join(process.cwd(), "components", "auth-login-panel.tsx"), "utf8");
const loginPageSource = await readFile(join(process.cwd(), "app", "auth", "login", "page.tsx"), "utf8");
const adminPageSource = await readFile(join(process.cwd(), "app", "auth", "admin-login", "page.tsx"), "utf8").catch(() => "");
expect(panelSource).toContain("authMode");
expect(panelSource).toContain("alternateHref");
expect(loginPageSource).toContain("/auth/admin-login");
expect(adminPageSource).toContain('authMode="admin"');
expect(panelSource).toContain('phone: submittedPhone');
expect(panelSource).toContain('inputMode="tel"');
expect(panelSource).toContain('name="phone"');
expect(panelSource).toContain('name="password"');
expect(panelSource).toContain('new FormData(event.currentTarget)');
expect(panelSource).not.toContain('disabled={!configured || submitting || !phone.trim() || !password}');
expect(panelSource).not.toContain("authMode");
expect(panelSource).not.toContain("alternateHref");
expect(loginPageSource).not.toContain("/auth/admin-login");
expect(adminPageSource).toContain("/auth/login");
});
});