auto-save 2026-05-29 16:54 (~2)
This commit is contained in:
@@ -32,12 +32,6 @@ function loginNextPath() {
|
||||
return normalizeNextPath(new URLSearchParams(window.location.search).get("next"))
|
||||
}
|
||||
|
||||
function isFeishuClient() {
|
||||
if (typeof window === "undefined") return false
|
||||
const ua = window.navigator.userAgent.toLowerCase()
|
||||
return ua.includes("feishu") || ua.includes("lark")
|
||||
}
|
||||
|
||||
export default function LoginPage() {
|
||||
const [authConfig, setAuthConfig] = useState<AuthConfig | null>(null)
|
||||
const [nextPath] = useState(loginNextPath)
|
||||
@@ -83,7 +77,7 @@ export default function LoginPage() {
|
||||
const passwordEnabled = authConfig?.password_enabled ?? true
|
||||
|
||||
useEffect(() => {
|
||||
if (!feishuEnabled || status !== "idle" || autoFeishuAttemptedRef.current || !isFeishuClient()) return
|
||||
if (!feishuEnabled || status !== "idle" || autoFeishuAttemptedRef.current) return
|
||||
const attemptKey = `skg-feishu-auto-login:${nextPath}`
|
||||
if (window.sessionStorage.getItem(attemptKey) === "1") return
|
||||
window.sessionStorage.setItem(attemptKey, "1")
|
||||
@@ -155,7 +149,7 @@ export default function LoginPage() {
|
||||
onClick={onFeishuLogin}
|
||||
>
|
||||
<Building2 className="h-4 w-4" />
|
||||
飞书免登录
|
||||
飞书登录
|
||||
<ArrowRight className="h-4 w-4" />
|
||||
</button>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user