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 <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-02-07 18:31:29 +09:00
parent a6e192c738
commit 2f45475bc5

View File

@@ -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;