로그인 차단 상태 런처 제한 표시

This commit is contained in:
seo
2026-07-10 21:11:39 +09:00
parent 6054479cee
commit 2106830a47
3 changed files with 37 additions and 0 deletions
+24
View File
@@ -77,6 +77,11 @@ const adminIconItems = [
async function renderIcons() {
const session = await getSession();
if (session.loginBlocked) {
renderLoginBlocked(session);
return;
}
const isAdmin = !!session.admin;
const items = isAdmin ? adminIconItems : userIconItems;
shortcut.className = `find-container ${isAdmin ? 'launcher-admin-grid' : ''}`;
@@ -129,6 +134,11 @@ async function getSession() {
async function requireAccess(nextAction) {
try {
const session = await getSession();
if (session.loginBlocked) {
renderLoginBlocked(session);
return;
}
if (session.admin || session.authenticated) {
nextAction && nextAction();
return;
@@ -139,6 +149,20 @@ async function requireAccess(nextAction) {
showPasswordForm(nextAction);
}
function renderLoginBlocked(session = {}) {
shortcut.className = 'launcher-blocked';
shortcut.innerHTML = '';
const title = document.createElement('strong');
title.textContent = '현재 로그인할 수 없는 상태입니다.';
const message = document.createElement('div');
message.textContent = session.blockedMessage || '잠시 후 다시 시도하세요.';
shortcut.appendChild(title);
shortcut.appendChild(message);
}
function showPasswordForm(onSuccess) {
shortcut.className = 'password-container';
shortcut.innerHTML = '';