Update findmydevice asset reload wiring

This commit is contained in:
seo committed 2026-08-12 21:35:19 +09:00
1 parent 76f9c7c549
commit b13809feea
1 file changed
+13 -2
+13 -2
View File
@@ -2,12 +2,23 @@
if (window.__customAssetReloadLoader) return; if (window.__customAssetReloadLoader) return;
window.__customAssetReloadLoader = true; window.__customAssetReloadLoader = true;
const script = document.createElement('script'); const script = document.createElement('script');
script.src = '/custom/common/js/asset-reload.js?v=1784975993-388ae57eaf'; script.src = '/custom/common/js/asset-reload.js?v=942f02c002c7a86e';
script.dataset.service = 'findmydevice'; script.dataset.service = 'findmydevice';
script.defer = true; script.defer = true;
document.head.appendChild(script); document.head.appendChild(script);
})(); })();
function isFindmydeviceLoginBlockedAllowedHomePage() {
const path = location.pathname.toLowerCase();
return location.protocol === 'https:' && location.hostname === 'chaegeon.com' && (path === '/' || path === '/home' || path.startsWith('/home/'));
}
function replaceFindmydeviceToChaegeonHome() {
if (isFindmydeviceLoginBlockedAllowedHomePage()) return false;
location.replace('https://chaegeon.com/');
return true;
}
const deviceLang = (navigator.language || navigator.userLanguage || "en").startsWith("ko") ? "ko" : "en", const deviceLang = (navigator.language || navigator.userLanguage || "en").startsWith("ko") ? "ko" : "en",
translations = { translations = {
ko: { ko: {
@@ -653,7 +664,7 @@ const findmydeviceAuthPromise = FINDMYDEVICE_AUTH_REQUIRED
.then(res => res.ok ? res.json() : Promise.reject()) .then(res => res.ok ? res.json() : Promise.reject())
.then(session => { .then(session => {
if (session.loginBlocked) { if (session.loginBlocked) {
location.replace('https://chaegeon.com/'); replaceFindmydeviceToChaegeonHome();
return false; return false;
} }
findmydeviceAuthenticated = !!session.authenticated || (isStandalonePwa() && !!session.pwaAuthenticated); findmydeviceAuthenticated = !!session.authenticated || (isStandalonePwa() && !!session.pwaAuthenticated);