This commit is contained in:
@@ -1,14 +1,3 @@
|
||||
// Debug 환경에서 .pdb 파일 요청 차단 (WASM 부팅 최적화)
|
||||
if (window.taxbaikBlockPdb) {
|
||||
const originalFetch = window.fetch;
|
||||
window.fetch = function(url, ...args) {
|
||||
if (typeof url === 'string' && url.includes('.pdb')) {
|
||||
return Promise.reject(new TypeError('Blocked: pdb'));
|
||||
}
|
||||
return originalFetch.apply(window, [url, ...args]);
|
||||
};
|
||||
}
|
||||
|
||||
window.taxbaikAdminSession = {
|
||||
clientLogState: {
|
||||
enabled: true,
|
||||
@@ -218,6 +207,30 @@ window.taxbaikAdminSession = {
|
||||
}
|
||||
},
|
||||
|
||||
getLocalStorageItem: function (key) {
|
||||
try {
|
||||
return localStorage.getItem(key);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
setLocalStorageItem: function (key, value) {
|
||||
try {
|
||||
localStorage.setItem(key, value);
|
||||
} catch {
|
||||
// Ignore storage errors.
|
||||
}
|
||||
},
|
||||
|
||||
removeLocalStorageItem: function (key) {
|
||||
try {
|
||||
localStorage.removeItem(key);
|
||||
} catch {
|
||||
// Ignore storage errors.
|
||||
}
|
||||
},
|
||||
|
||||
showLoading: function () {
|
||||
// Route transitions are handled by Blazor; avoid full-screen overlays
|
||||
// that block drawer interaction and make the app feel frozen.
|
||||
@@ -326,14 +339,26 @@ window.taxbaikAdminSession = {
|
||||
}
|
||||
|
||||
window.taxbaikAdminSession.traceUiState('admin-login', 'submit started');
|
||||
const response = await fetch('/taxbaik/api/auth/login', {
|
||||
const loginUrl = new URL('/taxbaik/api/auth/login', window.location.origin).toString();
|
||||
const response = await fetch(loginUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ username, password })
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('login failed');
|
||||
let errorDetail = '';
|
||||
try {
|
||||
errorDetail = await response.text();
|
||||
} catch {
|
||||
// ignore response body read errors
|
||||
}
|
||||
const suffix = errorDetail ? `: ${errorDetail}` : '';
|
||||
const error = new Error(`login failed (${response.status} ${response.statusText})${suffix}`);
|
||||
error.loginStatus = response.status;
|
||||
error.loginStatusText = response.statusText;
|
||||
error.loginResponse = errorDetail;
|
||||
throw error;
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
@@ -374,7 +399,10 @@ window.taxbaikAdminSession = {
|
||||
component: 'AdminLoginForm',
|
||||
viewportWidth: window.taxbaikAdminSession.getViewportWidth(),
|
||||
userAgent: navigator.userAgent || '',
|
||||
stack: error?.stack || ''
|
||||
stack: error?.stack || '',
|
||||
responseStatus: error?.loginStatus || '',
|
||||
responseStatusText: error?.loginStatusText || '',
|
||||
responseBody: (error?.loginResponse || '').slice(0, 500)
|
||||
});
|
||||
}
|
||||
const errorMessage = document.createElement('div');
|
||||
|
||||
Reference in New Issue
Block a user