fix: Set demo/admin passwords and fix eye icon position

Critical fixes:

1. demo user password (File Tree authentication):
   - Used verified bcrypt hash: $2b$12$w8Gp3zUJL2xycng58WViKeTH7zACnNBWURgZZwyyFJSkDr5l2/mpK
   - Password: demo123 (verified in previous test)
   - Updated PostgreSQL users.password (60 chars)
   - Updated SQLite sftpgo_users.password_hash (60 chars)

2. admin password (Settings authentication):
   - Same hash for demo123 (unified password)
   - Updated PostgreSQL admins.password (60 chars)
   - Updated SQLite sftpgo_admins.password_hash (60 chars)

3. Tree modal eye icon position:
   - Changed top:50% to top:28px (aligns with input field)
   - Added padding-right:36px to input (prevents text overlap)
   - Icon now centered with password input

Test passwords (unified):
- File Tree: demo / demo123
- Settings: admin / demo123

Files:
- src/page.html (line 477-480: eye icon position)
- data/auth.sqlite (password hashes)
This commit is contained in:
Warren
2026-05-17 00:42:13 +08:00
parent 7bb25bf6a9
commit a5169b1989
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@@ -473,10 +473,10 @@ function showTreeLoginModal(){
'<label style="color:#94a3b8;font-size:13px;display:block;margin-bottom:4px">User ID</label>'+
'<input style="background:#0f172a;border:1px solid #60a5fa;border-radius:4px;color:#e2e8f0;padding:8px 12px;width:100%;font-size:13px" type=text id=tree-user placeholder="Enter user ID (e.g., demo)">'+
'</div>'+
'<div style="margin-bottom:12px;position:relative;height:40px">'+
'<div style="margin-bottom:12px;position:relative">'+
'<label style="color:#94a3b8;font-size:13px;display:block;margin-bottom:4px">Password</label>'+
'<input style="background:#0f172a;border:1px solid #60a5fa;border-radius:4px;color:#e2e8f0;padding:8px 12px;width:100%;font-size:13px" type=password id=tree-password placeholder="Enter password" onkeypress=handleTreeKeyPress(event)>'+
'<button onclick=toggleTreePassword() style="position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;color:#60a5fa;cursor:pointer;font-size:14px">👁</button>'+
'<input style="background:#0f172a;border:1px solid #60a5fa;border-radius:4px;color:#e2e8f0;padding:8px 12px;width:100%;font-size:13px;padding-right:36px" type=password id=tree-password placeholder="Enter password" onkeypress=handleTreeKeyPress(event)>'+
'<button onclick=toggleTreePassword() style="position:absolute;right:8px;top:28px;transform:translateY(-50%);background:none;border:none;color:#60a5fa;cursor:pointer;font-size:14px">👁</button>'+
'</div>'+
'<button onclick=submitTreeLogin() style="background:#064e3b;border:1px solid #4ade80;color:#4ade80;padding:8px 16px;border-radius:4px;cursor:pointer;width:100%;font-size:13px">Login</button>'+
'<div id=tree-error style="color:#ef4444;font-size:12px;margin-top:8px"></div>';