Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login.js #14

Open
PriyaDoIT opened this issue Apr 28, 2018 · 0 comments
Open

Login.js #14

PriyaDoIT opened this issue Apr 28, 2018 · 0 comments

Comments

@PriyaDoIT
Copy link

What does this.props.setCurrentUser(user) do in the code below from Login.js ?

app.auth().fetchProvidersForEmail(email) .then((providers) => { if (providers.length === 0) { // create user return app.auth().createUserWithEmailAndPassword(email, password) } else if (providers.indexOf("password") === -1) { // they used facebook this.loginForm.reset() this.toaster.show({ intent: Intent.WARNING, message: "Try alternative login." }) } else { // sign user in return app.auth().signInWithEmailAndPassword(email, password) } }) .then((user) => { if (user && user.email) { this.loginForm.reset() **this.props.setCurrentUser(user)** this.setState({redirect: true}) } }) .catch((error) => { this.toaster.show({ intent: Intent.DANGER, message: error.message }) }) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant