18.07 Logout Button - Log the User Out

This commit is contained in:
fwarren committed 2021-02-13 19:46:06 -08:00
1 parent e127886523
commit 27563c4d21
2 files changed
+6 -1

No files matched your search

+3 -1
View File
@@ -15,6 +15,7 @@
/>
<q-btn
v-else
@click="logoutUser"
flat
icon-right="account_circle"
label="Logout"
@@ -65,7 +66,7 @@
</template>
<script>
import { mapState } from 'vuex'
import { mapState, mapActions } from 'vuex'
export default {
name: 'MainLayout',
@@ -93,6 +94,7 @@ export default {
...mapState('auth', ['loggedIn'])
},
methods: {
...mapActions('auth', ['logoutUser'])
}
}
</script>
+3
View File
@@ -29,6 +29,9 @@ const actions = {
console.log('error.message: ', error)
})
},
logoutUser () {
firebaseAuth.signOut()
},
handleAuthStateChange ({ commit }) {
firebaseAuth.onAuthStateChanged(function (user) {
if (user) {