Added auth functionality, initial work with views and field types
This commit is contained in:
@@ -1,6 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { LayoutGrid } from 'lucide-vue-next'
|
||||
import LoginForm from '@/components/LoginForm.vue'
|
||||
|
||||
// Skip auth middleware for login page
|
||||
definePageMeta({
|
||||
auth: false
|
||||
})
|
||||
|
||||
const { toast } = useToast()
|
||||
|
||||
// Check for auth message from cookie
|
||||
const authMessage = useCookie('authMessage')
|
||||
|
||||
onMounted(() => {
|
||||
if (authMessage.value) {
|
||||
console.log('Displaying auth message: ' + authMessage.value)
|
||||
const message = authMessage.value
|
||||
|
||||
// Show success toast for logout, error for auth failures
|
||||
if (message.toLowerCase().includes('logged out')) {
|
||||
toast.success(message)
|
||||
} else {
|
||||
toast.error(message)
|
||||
}
|
||||
|
||||
// Clear the message after displaying
|
||||
authMessage.value = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user