Update findmydevice asset reload wiring
This commit is contained in:
1 parent
76f9c7c549
commit
b13809feea
1 file changed
+13
-2
+13
-2
@@ -2,12 +2,23 @@
|
||||
if (window.__customAssetReloadLoader) return;
|
||||
window.__customAssetReloadLoader = true;
|
||||
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.defer = true;
|
||||
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",
|
||||
translations = {
|
||||
ko: {
|
||||
@@ -653,7 +664,7 @@ const findmydeviceAuthPromise = FINDMYDEVICE_AUTH_REQUIRED
|
||||
.then(res => res.ok ? res.json() : Promise.reject())
|
||||
.then(session => {
|
||||
if (session.loginBlocked) {
|
||||
location.replace('https://chaegeon.com/');
|
||||
replaceFindmydeviceToChaegeonHome();
|
||||
return false;
|
||||
}
|
||||
findmydeviceAuthenticated = !!session.authenticated || (isStandalonePwa() && !!session.pwaAuthenticated);
|
||||
|
||||
Reference in new issue
Block a user