Fix bcrypt password hash for demo user + add test generator
This commit is contained in:
Binary file not shown.
@@ -261,3 +261,14 @@ mod tests {
|
|||||||
assert!(dir.is_some());
|
assert!(dir.is_some());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_bcrypt_hash() {
|
||||||
|
let password = "demo123";
|
||||||
|
let hash = bcrypt::hash(password, bcrypt::DEFAULT_COST).unwrap();
|
||||||
|
println!("Hash for demo123: {}", hash);
|
||||||
|
|
||||||
|
// Verify the hash works
|
||||||
|
let valid = bcrypt::verify(password, &hash).unwrap();
|
||||||
|
assert!(valid);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user