relax password restrictions

This commit is contained in:
ntr
2019-10-25 21:54:46 +11:00
parent cfd2caa4d3
commit 3183f56a4a
4 changed files with 4 additions and 27 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ use img;
use failure::Error;
use failure::{err_msg, format_err};
static PASSWORD_MIN_LEN: usize = 11;
static PASSWORD_MIN_LEN: usize = 3;
#[derive(Debug,Clone,Serialize,Deserialize)]
pub struct Account {
@@ -318,7 +318,7 @@ pub fn set_subscribed(tx: &mut Transaction, id: Uuid, subscribed: bool) -> Resul
}
pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result<String, MnmlHttpError> {
if password.len() < PASSWORD_MIN_LEN {
if password.len() < PASSWORD_MIN_LEN || password.len() > 100 {
return Err(MnmlHttpError::PasswordUnacceptable);
}
+1 -1
View File
@@ -449,7 +449,7 @@ 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;
},