로그인 차단 상태 런처 제한 표시
This commit is contained in:
+24
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user