Skip to content

Login.js  #14

@PriyaDoIT

Description

@PriyaDoIT

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 }) }) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions