-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathLogout.vue
32 lines (30 loc) · 941 Bytes
/
Logout.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<script setup>
import { LogOut } from 'lucide-vue-next'
function logOut() {
localStorage.removeItem('SinkSiteToken')
navigateTo('/dashboard/login')
}
</script>
<template>
<AlertDialog>
<AlertDialogTrigger as-child>
<LogOut
class="w-4 h-4 cursor-pointer"
/>
</AlertDialogTrigger>
<AlertDialogContent class="max-w-[95svw] max-h-[95svh] md:max-w-lg grid-rows-[auto_minmax(0,1fr)_auto]">
<AlertDialogHeader>
<AlertDialogTitle>{{ $t('logout.title') }}</AlertDialogTitle>
<AlertDialogDescription>
{{ $t('logout.confirm') }}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>{{ $t('common.cancel') }}</AlertDialogCancel>
<AlertDialogAction @click="logOut">
{{ $t('logout.action') }}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</template>