signIn() { const { email, password } = this.state; firebaseApp.auth().signInWithEmailAndPassword(email, password) .then(this.props.history.push('/app')) .catch(error => { this.setState({error}); }) }
firebase.auth() .signInWithEmailAndPassword(email, password) .catch((error) => { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; this.setState({ errorMessage, loading: false }) });
onLoginPress() { this.setState({ error: '', loading: true }); const { email, password } = this.state; firebase.auth().signInWithEmailAndPassword(email, password) .then(() => { this.setState({ error: '', loading: false }); this.props.navigation.navigate('Home'); }) .catch(() => { this.setState({ error: 'Authentication failed', loading: false }); }); }
export async function signIn(email, password) { await firebase.auth().signInWithEmailAndPassword(email, password); }
firebase .auth() .signInWithEmailAndPassword(email,password) .then(()=>{ this.props.navigation.replace('Home') }) .catch(error=>{alert(error.message)})
static async signinWithEmailAndPassword( email, password, rememberMe = false, ) { const persistence = rememberMe ? firebase.auth.Auth.Persistence.LOCAL : firebase.auth.Auth.Persistence.SESSION; await firebase.auth().setPersistence(persistence); return firebase .auth() .signInWithEmailAndPassword(email, password); }
const signIn = (email, password) => { return firebase.auth().signInWithEmailAndPassword(email, password) .then((response) => { return setSessionFromApi(response); }, (error) => { setSession(); return { errorCode: error.code, errorMessage: error.message }; }); }
SignIn(){ console.log('state',this.state); const {email,password} = this.state; firebaseApp.auth().signInWithEmailAndPassword(email,password) .catch(error => { console.log('error',error); this.setState({error}) }) }
handleSignIn() { this.setState({ error: false }) firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password) .catch(error => this.setState({ error: error.message })) }
const loginUser = ({email, password}) => { return (dispatch) => { dispatch({type: LOGIN_USER}); firebase.auth().signInWithEmailAndPassword(email, password) .then((user) => loginUserSuccess(dispatch, user)) .catch(() => loginUserFail(dispatch)) } }
logIn(user: any) { this.afAuth.auth.signInWithEmailAndPassword(user.username, user.password) .then(res => console.log(res)) .catch(function(error) { // Handle Errors here. }); }
firebase .auth() .signInWithEmailAndPassword(this.state.email, this.state.password) .then((user) => { this.setState({ isLoading: false }); console.log('User', user, 'logged!'); this.props.navigation.navigate('Search'); }) .catch((error) => { this.setState({ isLoading: false, error: error.message }); });
signIn() { const { email, password } = this.state; firebaseApp.auth().signInWithEmailAndPassword(email, password) .then(() => { this.setState({isLoggedIn: true}); browserHistory.push('/newsfeed'); }) .catch(error => { this.setState({ error }); }) }
/** * @param {email: string, password: string} data * @return {Promise} */ signin(data) { const { email, password } = data; return new Promise((resolve, reject) => { firebase.auth().signInWithEmailAndPassword(email, password) .then((res) => { resolve(res); }) .catch(reject); }); }
const login = (email, password) => { return firebase.auth().signInWithEmailAndPassword(email, password) }