I am working on a react app and implemented a firebase auth method for login with email address or password. It works fine But now I don't need to login with an email address, I need to login with a username and password ?
export const signinUserInFirebase = (user, history) => (dispatch) => {
dispatch({ type: LOGIN_USER });
console.log('data', user.email, user.password)
firebase.auth()
.signInWithEmailAndPassword(user.email, user.password)
.then((user) => {
localStorage.setItem("user_id", "user-id");
dispatch({ type: LOGIN_USER_SUCCESS, payload: localStorage.getItem('user_id') });
history.push('/');
NotificationManager.success('User Login Successfully!');
})
.catch((error) => {
dispatch({ type: LOGIN_USER_FAILURE });
NotificationManager.error(error.message);
});
}