Skip to content

fix for signup in signup.vue #6

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

Open
szczynk opened this issue Sep 18, 2020 · 0 comments
Open

fix for signup in signup.vue #6

szczynk opened this issue Sep 18, 2020 · 0 comments

Comments

@szczynk
Copy link

szczynk commented Sep 18, 2020

for whose get error when signup here a fix for you
i'm using firestore as database

`signup.vue

methods: {

...mapActions('modules/user', [ 'login' ]),

async signUp () {

  try {

    const firebaseUser = await firebaseApp.auth().createUserWithEmailAndPassword(this.email, this.password)

    await this.writeUserData(firebaseUser.user.uid, firebaseUser.user.email)

    await this.login(firebaseUser.user)

    this.$router.push('/protected')

  } catch (error) {

    console.log(error.message)

  }

},

writeUserData (userId, email) {

  return firebaseApp.firestore().collection('users').doc(userId).set({

    email: email

  })

}

}`

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