api-client/components/firebase/Logout.vue

32 lines
629 B
Vue
Raw Normal View History

2020-03-05 01:18:10 +00:00
<template>
<div>
2021-05-17 13:47:57 +00:00
<button v-close-popover class="icon" @click="logout">
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>
2021-06-14 04:07:30 +00:00
<script lang="ts">
import Vue from "vue"
import { signOutUser } from "~/helpers/fb/auth"
2020-03-05 01:18:10 +00:00
2021-06-14 04:07:30 +00:00
export default Vue.extend({
2020-03-05 01:18:10 +00:00
methods: {
async logout() {
try {
2021-06-14 04:07:30 +00:00
await signOutUser()
2021-06-14 04:07:30 +00:00
this.$toast.info(this.$t("logged_out").toString(), {
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
},
},
2021-06-14 04:07:30 +00:00
})
2020-03-05 01:18:10 +00:00
</script>