Skip to content

Commit

Permalink
fix(Register): use new API for registering
Browse files Browse the repository at this point in the history
  • Loading branch information
jkklapp committed May 30, 2022
1 parent f4df329 commit e3ad4c6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions frontend/src/components/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

<script>
import { getAuth } from '../auth';
import { createUserWithEmailAndPassword } from 'firebase/auth';
export default {
data() {
Expand All @@ -86,16 +87,18 @@ export default {
},
methods: {
submit() {
getAuth()
.createUserWithEmailAndPassword(this.form.email, this.form.password)
.then((data) => {
data.user
.updateProfile({
displayName: this.form.name,
})
.then(() => {
this.$router.replace({ name: 'Dashboard' });
});
createUserWithEmailAndPassword(
getAuth(),
this.form.email,
this.form.password,
)
.then(({ user }) => {
user.updateProfile({
displayName: this.form.name,
});
})
.then(() => {
this.$router.replace({ name: 'Dashboard' });
})
.catch((err) => {
this.error = err.message;
Expand Down

0 comments on commit e3ad4c6

Please sign in to comment.