Add confirmation
This commit is contained in:
parent
abecf095f2
commit
f8dda817e8
|
@ -53,6 +53,11 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
|
|
||||||
async function onLogout() {
|
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({
|
const success = await trpc.logout.mutate({
|
||||||
username: props.loginResult.username,
|
username: props.loginResult.username,
|
||||||
domain: props.loginResult.domain
|
domain: props.loginResult.domain
|
||||||
|
@ -65,6 +70,7 @@ async function onLogout() {
|
||||||
alert('Não foi possível fazer logout. Tente novamente.')
|
alert('Não foi possível fazer logout. Tente novamente.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function onClose() {
|
function onClose() {
|
||||||
window.location.href = 'https://www.ifms.edu.br'
|
window.location.href = 'https://www.ifms.edu.br'
|
||||||
|
|
|
@ -23,12 +23,6 @@ import { LoginResult } from '@/server/interfaces/Auth'
|
||||||
const loginResult = ref<LoginResult | null>(null)
|
const loginResult = ref<LoginResult | null>(null)
|
||||||
|
|
||||||
function onLogin(event: LoginResult) {
|
function onLogin(event: LoginResult) {
|
||||||
console.log(event)
|
|
||||||
|
|
||||||
loginResult.value = event
|
loginResult.value = event
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLogout() {
|
|
||||||
loginResult.value = null
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user