login form

This commit is contained in:
ntr
2018-09-22 21:59:23 +10:00
parent 836cbddb63
commit 6188fafdf2
12 changed files with 140 additions and 35 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
use uuid::Uuid;
use bcrypt::{DEFAULT_COST, hash, verify};
use bcrypt::{hash, verify};
use rand::{thread_rng, Rng};
use rand::distributions::Alphanumeric;
use std::iter;
@@ -61,7 +61,7 @@ pub fn create(params: AccountCreateParams, db: Db) -> Result<RpcResult, Error> {
if params.password.len() < PASSWORD_MIN_LEN {
return Err(err_msg("password must be at least 12 characters"));
}
let password = hash(&params.password, DEFAULT_COST)?;
let password = hash(&params.password, 4)?;
let mut rng = thread_rng();
let token: String = iter::repeat(())