Use server session check for access

This commit is contained in:
seo
2026-06-12 15:43:19 +09:00
parent 61866ef8d6
commit 5d73ac520b
2 changed files with 12 additions and 5 deletions
+10 -5
View File
@@ -434,11 +434,16 @@ document.addEventListener('DOMContentLoaded', () => {
return (window.matchMedia('(display-mode: standalone)').matches) || (window.navigator.standalone === true);
}
// 조건: /findmydevice로 시작하고 access 쿠키가 없으며, PWA가 아닌 경우에만 리디렉션
if (location.pathname.startsWith('/findmydevice') && getCookie('access') !== '9KxH6236' && !isInStandaloneMode()) {
location.replace('/blog');
return; // 이하 코드 실행 방지
}
if (location.pathname.startsWith('/findmydevice') && !isInStandaloneMode()) {
fetch('/custom/launcher/api.php?session=1', { credentials: 'same-origin' })
.then(res => res.ok ? res.json() : Promise.reject())
.then(session => {
if (!session.authenticated) {
location.replace('/blog');
}
})
.catch(() => location.replace('/blog'));
}
const btnArea = document.querySelector('body > div.btnArea');
const pageModifyLink = btnArea?.querySelectorAll('a')[1]?.getAttribute('href') || '';