From f5df00df4e752b920fb1ac0ac91ff6e419c2c51a Mon Sep 17 00:00:00 2001 From: zetaloop Date: Sat, 28 Feb 2026 07:26:05 +0800 Subject: [PATCH] refactor(auth): align auth UI and mock auth API --- app/(account)/verify/page.tsx | 39 +++++++++- app/(auth)/forgot-password/page.tsx | 114 +++++++++++++++++++++++++--- app/(auth)/login/page.tsx | 33 +++++--- app/(auth)/register/page.tsx | 64 +++++++++++----- components/login-dialog.tsx | 30 +++++--- lib/api/auth-extra.ts | 4 + lib/api/auth.ts | 93 +++++++++++++++++++++++ lib/api/email.ts | 4 + lib/api/files.ts | 4 + lib/api/index.ts | 4 + store/auth.ts | 4 +- 11 files changed, 337 insertions(+), 56 deletions(-) create mode 100644 lib/api/auth-extra.ts create mode 100644 lib/api/auth.ts create mode 100644 lib/api/email.ts create mode 100644 lib/api/files.ts diff --git a/app/(account)/verify/page.tsx b/app/(account)/verify/page.tsx index 859f1ff..d38ccb4 100644 --- a/app/(account)/verify/page.tsx +++ b/app/(account)/verify/page.tsx @@ -21,6 +21,9 @@ import { useEffect, useRef, useState } from "react" export default function VerifyPage() { const [verifyRole, setVerifyRole] = useState("") + const [realName, setRealName] = useState("") + const [idNumber, setIdNumber] = useState("") + const [gameProfile, setGameProfile] = useState("") const verificationStatus = useAuthStore((state) => state.verificationStatus) const verificationReasons = useAuthStore((state) => state.verificationReasons) const verifiedRoles = useAuthStore((state) => state.verifiedRoles) @@ -38,8 +41,21 @@ export default function VerifyPage() { [], ) + const buildMaterials = () => { + const materials: Record = { + realName, + idNumber, + gameProfile, + idCardFront: "mock://idCardFront", + idCardBack: "mock://idCardBack", + gameScreenshot: "mock://gameScreenshot", + } + + return materials + } + const submitWithMockApproval = (role: UserRole) => { - submitVerification(role) + submitVerification(role, buildMaterials()) const oldTimer = timersRef.current.get(role) if (oldTimer) { clearTimeout(oldTimer) @@ -149,19 +165,34 @@ export default function VerifyPage() {
- + setRealName(event.target.value)} + />
- + setIdNumber(event.target.value)} + />
-