Complete sermon management system with Nuxt 4, authentication, SQLite database, QR codes, and Docker deployment

This commit is contained in:
Ryderjj89
2025-09-29 18:59:31 -04:00
commit c033410c2e
25 changed files with 1510 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { verifyJWT } from '~/server/utils/auth'
export default defineEventHandler(async (event) => {
const token = getCookie(event, 'auth_token')
if (!token) {
throw createError({
statusCode: 401,
statusMessage: 'No authentication token provided'
})
}
const payload = await verifyJWT(token)
if (!payload) {
throw createError({
statusCode: 401,
statusMessage: 'Invalid authentication token'
})
}
return {
user: {
id: payload.userId,
username: payload.username
}
}
})