From 2f45475bc54be66d54dc62c2c05ba257282fd16f Mon Sep 17 00:00:00 2001 From: dsyoon Date: Sat, 7 Feb 2026 18:31:29 +0900 Subject: [PATCH] Fix Auth modal cfg redeclare and auto-open setup Remove duplicate cfg declaration causing Chrome SyntaxError and auto-open the login setup modal once per browser when Auth0 is not configured. Co-authored-by: Cursor --- script.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script.js b/script.js index 7c5a79c..38964d2 100644 --- a/script.js +++ b/script.js @@ -10,6 +10,7 @@ const THEME_KEY = "links_home_theme_v1"; const AUTH_TOAST_ONCE_KEY = "links_home_auth_toast_once_v1"; const AUTH_OVERRIDE_KEY = "links_home_auth_override_v1"; + const AUTH_SETUP_SHOWN_KEY = "links_home_auth_setup_shown_v1"; const el = { subtitle: document.getElementById("subtitle"), @@ -511,6 +512,11 @@ auth.mode = "misconfigured"; updateAuthUi(); applyManageLock(); + // 브라우저당 1회: 설정 모달 자동 오픈 + if (!localStorage.getItem(AUTH_SETUP_SHOWN_KEY)) { + localStorage.setItem(AUTH_SETUP_SHOWN_KEY, "1"); + setTimeout(() => openAuthModal(), 80); + } return; } @@ -637,12 +643,6 @@ } function openAuthModal() { - // 운영자만 설정하도록: 기본값은 end-user 설정 비활성 - const cfg = getAuthConfig(); - if (!cfg.allowEndUserConfig) { - toast("로그인 설정은 관리자만 할 수 있습니다. 관리자에게 문의하세요."); - return; - } if (!el.authModal || !el.authForm) { toast("로그인 설정 UI를 찾지 못했습니다. 새로고침 후 다시 시도하세요."); return;