Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleForgotPasswordRoute() {
// @todo: implement route
return Actions.main();
}
async function firebaseSignup(email, pass) {
try {
await firebase.auth().createUserWithEmailAndPassword(email, pass);
alert("Account created");
// Navigate to the Home page, the user is auto logged in
Actions.main({type: ActionConst.RESET});
Actions.calculate();
// Storing user's email in Local storage by dispatching setStorage action
dispatch(setStorage(email));
return true;
} catch (error) {
alert(error.toString());
return false;
}
}
callback() {
return Actions.main();
}
processAuth(props) {
if(props.auth.user != null) {
if(props.auth.user.uid) {
Actions.main({ type: 'reset' });
}else{
Actions.login({ type: 'reset' });
}
}
}
const loginUserSuccess = (dispatch, user) => {
dispatch({
type: LOGIN_USER_SUCCESS,
payload: user
});
Actions.main();
};
.then(user => {
dispatch(loaderToggle());
dispatch(receiveAuth(user));
Actions.main({ type: ActionConst.REPLACE });
})
.catch(error => {
firebase.auth().onAuthStateChanged((user) => {
if (user) {
doWatchList((val) => {
dispatch({ type: 'fetchSuccess', payload: val });
});
Actions.main();
} else {
Actions.auth();
}
});
}