feature: implement persistent login username and remember-me checkbox
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m42s
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m42s
Problem: Login form showed remembered username from localStorage, but didn't restore the 'remember me' checkbox state. Users had to re-check the box on each login attempt, defeating the purpose of the remember feature. Solution: 1. AdminLoginForm: Add isRememberChecked field and RememberedCheckboxKey constant 2. OnInitializedAsync: Restore both username AND checkbox state from localStorage 3. admin-session.js bindLoginForm: Restore checkbox.checked from localStorage 4. admin-session.js submit handler: Save checkbox state alongside username Result: Complete round-trip persistence - when user checks 'remember me' and logs in, both username and checkbox state persist until explicitly cleared. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -277,6 +277,19 @@ window.taxbaikAdminSession = {
|
||||
if (label) label.textContent = '로그인';
|
||||
}
|
||||
|
||||
// 체크박스 상태 복원
|
||||
const rememberCheckbox = form.querySelector('input[type="checkbox"]');
|
||||
if (rememberCheckbox) {
|
||||
try {
|
||||
const savedState = localStorage.getItem('admin-remember-checkbox');
|
||||
if (savedState === 'true') {
|
||||
rememberCheckbox.checked = true;
|
||||
}
|
||||
} catch {
|
||||
// localStorage access error
|
||||
}
|
||||
}
|
||||
|
||||
if (form.dataset.bound === '1') return;
|
||||
form.dataset.bound = '1';
|
||||
window.taxbaikAdminSession.traceUiState('admin-login', 'bindLoginForm attached');
|
||||
@@ -322,8 +335,10 @@ window.taxbaikAdminSession = {
|
||||
|
||||
if (rememberMe) {
|
||||
localStorage.setItem('admin-remembered-username', username);
|
||||
localStorage.setItem('admin-remember-checkbox', 'true');
|
||||
} else {
|
||||
localStorage.removeItem('admin-remembered-username');
|
||||
localStorage.removeItem('admin-remember-checkbox');
|
||||
}
|
||||
|
||||
window.location.href = '/taxbaik/admin/dashboard';
|
||||
|
||||
Reference in New Issue
Block a user