From 76a6eb27102e4604f41d6d500a01dfcd4e09c039 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 18:49:21 +1100 Subject: [PATCH] only init logrocket once authed --- client/src/app.jsx | 4 ---- client/src/events.jsx | 1 + server/src/account.rs | 4 ++-- server/src/rpc.rs | 3 ++- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/client/src/app.jsx b/client/src/app.jsx index cfc877b7..e56f3044 100644 --- a/client/src/app.jsx +++ b/client/src/app.jsx @@ -15,10 +15,6 @@ const registerEvents = require('./events'); const Mnml = require('./components/mnml'); -if (process.env.NODE_ENV !== 'development') { - LogRocket.init('yh0dy3/mnml'); -} - function stripeKey() { if (window.location.host === 'mnml.gg') return 'pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq'; return 'pk_test_Cb49tTqTXpzk7nEmlGzRrNJg00AU0aNZDj'; diff --git a/client/src/events.jsx b/client/src/events.jsx index 6f42c894..aaf0fdf8 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -127,6 +127,7 @@ function registerEvents(store) { function setAccount(account) { if (account) { + LogRocket.init('yh0dy3/mnml'); LogRocket.identify(account.id, account); } diff --git a/server/src/account.rs b/server/src/account.rs index 56921e2c..e42ca9e9 100644 --- a/server/src/account.rs +++ b/server/src/account.rs @@ -189,7 +189,7 @@ pub fn new_img(tx: &mut Transaction, id: Uuid) -> Result { } pub fn set_password(tx: &mut Transaction, id: Uuid, current: &String, password: &String) -> Result { - 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(); diff --git a/server/src/rpc.rs b/server/src/rpc.rs index 3194c1d4..91c1068e 100644 --- a/server/src/rpc.rs +++ b/server/src/rpc.rs @@ -449,7 +449,8 @@ pub fn start(pool: PgPool, events_tx: CbSender, stripe: StripeClient) { out.send(Message::Binary(response)).unwrap(); } // we done - Err(_e) => { + Err(e) => { + info!("{:?}", e); break; }, };