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

View File

@ -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';

View File

@ -127,6 +127,7 @@ function registerEvents(store) {
function setAccount(account) {
if (account) {
LogRocket.init('yh0dy3/mnml');
LogRocket.identify(account.id, account);
}

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();

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;
},
};