Files
hoppscotch/components/firebase/Logout.vue
2021-06-14 00:11:57 -04:00

32 lines
629 B
Vue

<template>
<div>
<button v-close-popover class="icon" @click="logout">
<i class="material-icons">exit_to_app</i>
<span>{{ $t("logout") }}</span>
</button>
</div>
</template>
<script lang="ts">
import Vue from "vue"
import { signOutUser } from "~/helpers/fb/auth"
export default Vue.extend({
methods: {
async logout() {
try {
await signOutUser()
this.$toast.info(this.$t("logged_out").toString(), {
icon: "vpn_key",
})
} catch (err) {
this.$toast.show(err.message || err, {
icon: "error",
})
}
},
},
})
</script>