only init logrocket once authed

This commit is contained in:
ntr
2019-10-25 18:49:21 +11:00
parent 0172e1dba3
commit 76a6eb2710
4 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -189,7 +189,7 @@ pub fn new_img(tx: &mut Transaction, id: Uuid) -> Result<Account, Error> {
}
pub fn set_password(tx: &mut Transaction, id: Uuid, current: &String, password: &String) -> Result<String, MnmlHttpError> {
if password.len() < PASSWORD_MIN_LEN {
if password.len() < PASSWORD_MIN_LEN || password.len() > 100 {
return Err(MnmlHttpError::PasswordUnacceptable);
}
@@ -328,7 +328,7 @@ pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result<
let id = Uuid::new_v4();
let img = Uuid::new_v4();
let rounds = 8;
let rounds = 12;
let password = hash(&password, rounds)?;
let mut rng = thread_rng();
+2 -1
View File
@@ -449,7 +449,8 @@ pub fn start(pool: PgPool, events_tx: CbSender<Event>, stripe: StripeClient) {
out.send(Message::Binary(response)).unwrap();
}
// we done
Err(_e) => {
Err(e) => {
info!("{:?}", e);
break;
},
};