Lower bcrypt cost to 6 to improve login speed on low-end hardware
All checks were successful
Build MIPS Binary / build (push) Successful in 4m8s

This commit is contained in:
spinline
2026-02-07 16:24:06 +03:00
parent 9d0eb11f16
commit aed753c64f

View File

@@ -67,7 +67,9 @@ pub async fn setup_handler(
} }
// 3. Create User // 3. Create User
let password_hash = match bcrypt::hash(&payload.password, bcrypt::DEFAULT_COST) { // Lower cost for faster login on low-power devices (MIPS routers etc.)
// Default is usually 12, which takes ~3s on slow CPUs. 6 should be much faster.
let password_hash = match bcrypt::hash(&payload.password, 6) {
Ok(h) => h, Ok(h) => h,
Err(e) => { Err(e) => {
tracing::error!("Failed to hash password: {}", e); tracing::error!("Failed to hash password: {}", e);