api-client/components/firebase/Logout.vue

36 lines
608 B
Vue
Raw Normal View History

2020-03-05 01:18:10 +00:00
<template>
<div>
<button class="icon" @click="logout" v-close-popover>
2020-12-07 15:07:13 +00:00
<i class="material-icons">exit_to_app</i>
2020-03-05 01:18:10 +00:00
<span>{{ $t("logout") }}</span>
</button>
</div>
</template>
<script>
import { fb } from "~/helpers/fb"
2020-03-05 01:18:10 +00:00
export default {
data() {
return {
fb,
}
},
methods: {
async logout() {
try {
await fb.signOutUser()
this.$toast.info(this.$t("logged_out"), {
icon: "vpn_key",
})
} catch (err) {
this.$toast.show(err.message || err, {
icon: "error",
2020-03-05 01:18:10 +00:00
})
}
2020-03-05 01:18:10 +00:00
},
},
}
</script>