diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-08 19:17:20 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-08 19:17:20 +0900 |
| commit | 71171437060a45aea0ea9dbffac09877c0e6fdd5 (patch) | |
| tree | d0b2ce6c9d8922d1779c5a60d109e2d6822652d0 | |
| parent | f8b6e9abca7c3c56a1d446b5b283dec9f6789064 (diff) | |
modified recordings/recordings-plain.html
| -rw-r--r-- | layouts/recordings/recordings-plain.html | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/layouts/recordings/recordings-plain.html b/layouts/recordings/recordings-plain.html index 6849f5b..a36964d 100644 --- a/layouts/recordings/recordings-plain.html +++ b/layouts/recordings/recordings-plain.html @@ -114,12 +114,9 @@ // DOM이 준비되면 즉시 처리 function applyRestrictions() { const restrictedFolders = document.querySelectorAll('li.folder-section[data-restricted="true"]'); - console.log('Restricted folders found:', restrictedFolders.length); - console.log('isSiUser:', isSiUser); if (isSiUser) { restrictedFolders.forEach(folder => { folder.classList.add('allowed'); - console.log('Added allowed class to:', folder); }); } } @@ -130,22 +127,31 @@ applyRestrictions(); } - // API로 재확인 (비동기) - fetch('/api/whoami', { credentials: 'include' }) + // 쿠키가 없으면 재확인 (쿠키는 nginx에서 설정됨) + if (!isSiUser) { + setTimeout(() => { + const cookies2 = document.cookie.split(';').reduce((acc, cookie) => { + const [key, value] = cookie.trim().split('='); + acc[key] = value; + return acc; + }, {}); + if (cookies2.user === 'si' || cookies2.authUser === 'si') { + isSiUser = true; + applyRestrictions(); + } + }, 100); + } + + // API로 최종 확인 + fetch('/api/whoami.php', { credentials: 'include' }) .then(r => r.ok ? r.json() : null) .then(data => { - console.log('API response:', data); if (data && data.user === 'si') { isSiUser = true; applyRestrictions(); - } else { - console.log('Not si user. API user:', data ? data.user : 'no data'); - console.log('Cookies:', cookies); } }) - .catch(e => { - console.log('API error:', e); - }); + .catch(() => {}); })(); </script> </head> @@ -375,7 +381,7 @@ // API로 사용자 정보 확인 (nginx에서 헤더 읽기) let isSiUser = false; try { - const response = await fetch('/api/whoami', { + const response = await fetch('/api/whoami.php', { credentials: 'include' }); if (response.ok) { |
