Fix favicon and add authentication state to main page with logout/create sermon buttons
This commit is contained in:
BIN
logos/favicon.ico
Normal file
BIN
logos/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 149 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
@@ -16,7 +16,7 @@ export default defineNuxtConfig({
|
||||
{ name: 'description', content: 'Weekly sermons from New Life Christian Church' }
|
||||
],
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/png', href: '/logos/favicon.png' },
|
||||
{ rel: 'icon', type: 'image/x-icon', href: '/logos/favicon.ico' },
|
||||
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
||||
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' },
|
||||
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap' }
|
||||
|
||||
@@ -7,12 +7,29 @@
|
||||
<div class="flex items-center space-x-4">
|
||||
<img src="/logos/logo.png" alt="New Life Christian Church" class="h-16 w-auto" />
|
||||
</div>
|
||||
<NuxtLink
|
||||
to="/login"
|
||||
class="text-sm font-medium text-blue-600 hover:text-blue-700"
|
||||
>
|
||||
Admin Login
|
||||
</NuxtLink>
|
||||
<div class="flex items-center gap-4">
|
||||
<template v-if="isAuthenticated">
|
||||
<NuxtLink
|
||||
to="/admin"
|
||||
class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 font-medium text-sm"
|
||||
>
|
||||
Create New Sermon
|
||||
</NuxtLink>
|
||||
<button
|
||||
@click="handleLogout"
|
||||
class="text-sm font-medium text-red-600 hover:text-red-700"
|
||||
>
|
||||
Logout
|
||||
</button>
|
||||
</template>
|
||||
<NuxtLink
|
||||
v-else
|
||||
to="/login"
|
||||
class="text-sm font-medium text-blue-600 hover:text-blue-700"
|
||||
>
|
||||
Admin Login
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900">
|
||||
@@ -73,6 +90,10 @@
|
||||
<script setup lang="ts">
|
||||
const showOlder = ref(false)
|
||||
|
||||
// Check authentication status
|
||||
const { data: authData } = await useFetch('/api/auth/verify')
|
||||
const isAuthenticated = computed(() => authData.value?.authenticated || false)
|
||||
|
||||
// Fetch all sermons
|
||||
const { data: allSermons } = await useFetch('/api/sermons')
|
||||
|
||||
@@ -96,4 +117,9 @@ const olderSermons = computed(() => {
|
||||
return sermonDate < threeMonthsAgo
|
||||
})
|
||||
})
|
||||
|
||||
async function handleLogout() {
|
||||
await $fetch('/api/auth/logout', { method: 'POST' })
|
||||
await navigateTo('/login')
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user