const createUser = ({email, password}) => { return (dispatch) => { dispatch({type: CREATE_USER}); firebase.auth().createUserWithEmailAndPassword(email, password) .then((user) => loginUserSuccess(dispatch, user)) .catch(() => createUserFail(dispatch)); } }
SignUp(){ console.log('state',this.state); const {email,password} = this.state; firebaseApp.auth().createUserWithEmailAndPassword(email,password) .catch(error => { console.log('error',error); this.setState({error}) }) }
firebase.auth() .createUserWithEmailAndPassword(email, password) .catch((error) => { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; this.setState({ errorMessage, loading: false }) });
static async registerWithEmailAndPassword( email, password, ) { const credentials = await firebase .auth() .createUserWithEmailAndPassword(email, password); this.sendEmailVerification(credentials.user); return credentials.user; }
firebase .auth() .createUserWithEmailAndPassword(this.state.email, this.state.password) .then((user) => { this.setState({ isLoading: false }); console.log('User', user, 'registered!'); this.props.navigation.navigate('Search'); }) .catch((error) => { this.setState({ isLoading: false, error: error.message }); });
signUp() { const { email, password } = this.state; firebaseApp.auth().createUserWithEmailAndPassword(email, password) .catch(error => { this.setState({error}); }) }
onSignUpPress() { this.setState({ error: '', loading: true }); const { email, password } = this.state; firebase.auth().createUserWithEmailAndPassword(email, password) .then(() => { this.setState({ error: '', loading: false }); this.props.navigation.navigate('Home'); }) .catch(() => { this.setState({ error: 'Sign up failed', loading: false }); }); }
async signup() { DismissKeyboard(); try { await firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password); this.setState({ response: "account created" }); setTimeout(() => { this.props.navigator.push({ name: "Home" }) }, 1500); } catch (error) { this.setState({ response: error.toString() }) } }
export async function createNewUser(email, password) { await firebase.auth().createUserWithEmailAndPassword(email, password); }
await app .auth() .createUserWithEmailAndPassword(email.value, password.value); history.push("/"); } catch (error) {
firebase .auth() .createUserWithEmailAndPassword(email,password) .then(authenticate=>{ return authenticate.user .updateProfile({ displayName: name }) .then(()=>{ this.props.navigation.replace('Home') }) }) .catch(error=>{ alert(error.message) })
/** * @param {email: string, password: string} data * @return {Promise} */ signup(data) { const { email, password } = data; return new Promise((resolve, reject) => { firebase.auth().createUserWithEmailAndPassword(email, password) .then((res) => { resolve(res); }) .catch(reject); }); }
signUp() { const { email, password, confirmPassword } = this.state; console.log(`email = ${email} password = ${password} confirmPassword = ${confirmPassword}`); if (password === confirmPassword) { firebaseApp.auth().createUserWithEmailAndPassword(email, password) .then(() => { browserHistory.push('/newsfeed'); }) .catch(error => { this.setState({ error }) }) } else { this.setState({ error: { message: "Your Passwords dont match dummy."}}); } }
handleSignUp() { this.setState({ error: false }) firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password) .catch(error => this.setState({ error: error.message })) }
const signup = (email, pass) => firebase.auth().createUserWithEmailAndPassword(email, pass)