Add confirmation
This commit is contained in:
parent
abecf095f2
commit
f8dda817e8
|
@ -53,6 +53,11 @@ const props = defineProps({
|
|||
})
|
||||
|
||||
async function onLogout() {
|
||||
if (
|
||||
confirm(
|
||||
'Deseja realmente sair? Você será desconectado e não poderá navegar na Internet até fazer login novamente.'
|
||||
)
|
||||
) {
|
||||
const success = await trpc.logout.mutate({
|
||||
username: props.loginResult.username,
|
||||
domain: props.loginResult.domain
|
||||
|
@ -64,6 +69,7 @@ async function onLogout() {
|
|||
} else {
|
||||
alert('Não foi possível fazer logout. Tente novamente.')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onClose() {
|
||||
|
|
|
@ -23,12 +23,6 @@ import { LoginResult } from '@/server/interfaces/Auth'
|
|||
const loginResult = ref<LoginResult | null>(null)
|
||||
|
||||
function onLogin(event: LoginResult) {
|
||||
console.log(event)
|
||||
|
||||
loginResult.value = event
|
||||
}
|
||||
|
||||
function onLogout() {
|
||||
loginResult.value = null
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user