Implemented comprehensive Romanian Biblical Guide web app: - Next.js 15 with App Router and TypeScript - Material UI 7.3.2 for modern, responsive design - PostgreSQL database with Prisma ORM - Complete Bible reader with book/chapter navigation - AI-powered biblical chat with Romanian responses - Prayer wall for community prayer requests - Advanced Bible search with filters and highlighting - Sample Bible data imported from API.Bible - All API endpoints created and working - Professional Material UI components throughout - Responsive layout with navigation and theme 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
715 B
TypeScript
23 lines
715 B
TypeScript
import { NextResponse } from 'next/server'
|
|
import { getUserFromToken } from '@/lib/auth'
|
|
|
|
export async function GET(request: Request) {
|
|
try {
|
|
const authHeader = request.headers.get('authorization')
|
|
const token = authHeader?.replace('Bearer ', '')
|
|
|
|
if (!token) {
|
|
return NextResponse.json({ error: 'Token de autentificare necesar' }, { status: 401 })
|
|
}
|
|
|
|
const user = await getUserFromToken(token)
|
|
if (!user) {
|
|
return NextResponse.json({ error: 'Token invalid' }, { status: 401 })
|
|
}
|
|
|
|
return NextResponse.json({ user })
|
|
} catch (error) {
|
|
console.error('User validation error:', error)
|
|
return NextResponse.json({ error: 'Eroare de server' }, { status: 500 })
|
|
}
|
|
} |