From 6bbb813e6074c2a83d24ccd89e82533572970fec Mon Sep 17 00:00:00 2001 From: Roland Szpond Date: Mon, 2 Apr 2018 20:55:00 -0400 Subject: [PATCH 1/2] signin/signup action was only passing in the user id when the full firebase user response object is required to build out the user object in the store --- pages/auth/signin.vue | 2 +- pages/auth/signup.vue | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pages/auth/signin.vue b/pages/auth/signin.vue index 649ef54..2d54169 100755 --- a/pages/auth/signin.vue +++ b/pages/auth/signin.vue @@ -33,7 +33,7 @@ export default { ...mapActions('modules/user', [ 'login' ]), submit () { firebaseApp.auth().signInWithEmailAndPassword(this.email, this.password).then((firebaseUser) => { - return this.login(firebaseUser.uid) + return this.login(firebaseUser) }).then(() => { this.$router.push('/protected') }).catch((error) => { diff --git a/pages/auth/signup.vue b/pages/auth/signup.vue index c734809..14bc712 100755 --- a/pages/auth/signup.vue +++ b/pages/auth/signup.vue @@ -33,7 +33,7 @@ export default { try { const firebaseUser = await firebaseApp.auth().createUserWithEmailAndPassword(this.email, this.password) await this.writeUserData(firebaseUser.uid, firebaseUser.email) - await this.login(firebaseUser.uid) + await this.login(firebaseUser) this.$router.push('/protected') } catch (error) { console.log(error.message) @@ -82,4 +82,3 @@ export default { } - From 919e5ed0b3ed7e2d97906655385fb6b321ee2721 Mon Sep 17 00:00:00 2001 From: Roland Szpond Date: Mon, 2 Apr 2018 20:56:00 -0400 Subject: [PATCH 2/2] defaulting to display user email incase user name isnt available. Was making the demo look like it was broken cause the section was blank --- pages/protected/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/protected/index.vue b/pages/protected/index.vue index 30b7c7e..b63d7a2 100755 --- a/pages/protected/index.vue +++ b/pages/protected/index.vue @@ -7,7 +7,7 @@
User ID: {{ uid }}
-

Current User: {{user.name}}

+

Current User: {{user.name||user.email}}

All DB Users: {{ allusers }}