diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index dc527e4..f7f4470 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -51,16 +51,15 @@ function mcpAuthorizeCallback(params: URLSearchParams): string | null { return `/api/auth/mcp/authorize?${params.toString()}`; } -/** 展開中的第二種登入方式。一次只開一個,避免整張卡片變成一堆表單。 */ -type Method = "none" | "sso" | "password"; - function SignInMethods() { const t = useTranslations("auth.login"); const params = useSearchParams(); // ⚠️ 三種登入方式共用同一個 redirectTo。MCP 的 authorize query 只要有一條路徑 // 沒接上,ChatGPT / Claude / Codex 的 OAuth 流程就會在登入後斷在這裡。 const redirectTo = mcpAuthorizeCallback(params) || params.get("redirect") || "/dashboard"; - const [method, setMethod] = useState("none"); + // 帳密表單常駐在最上面(目錄審核帳號與自架者的主要入口,打開就能填); + // SSO 要另外收一個公司 email,所以維持「點了才展開」,展開時把 email 欄叫出來。 + const [ssoOpen, setSsoOpen] = useState(false); const [pending, setPending] = useState(false); async function onGoogle() { @@ -115,16 +114,33 @@ function SignInMethods() { return (
- + {/* 主要入口:email + 密碼,常駐可見,打開即可填。 */} +
+
+ + +
+
+ + +
+ +
@@ -132,99 +148,60 @@ function SignInMethods() {
- {method === "sso" ? ( -
-
- - -
- - -
- ) : null} + {/* 次要方式:Google 與 SSO。 */} +
+ - {method === "password" ? ( -
-
- - -
-
- - -
- - -
- ) : null} - - {method === "none" ? ( -
+ {ssoOpen ? ( +
+
+ + +
+ + +
+ ) : ( - {/* 帳密是給目錄審核帳號與自架者的退路,刻意做成不顯眼的文字連結。 */} - -
- ) : null} + )} +
); }