✨ Major Features Added: - AI Chat with conversation memory and university-specific knowledge base - Multi-tenant university support with white-label capabilities - Professional admin interface for knowledge base management - Advanced database schema with Prisma ORM - Comprehensive documentation and guides - Modern Next.js 15 + React 19 architecture - Bilingual support (English/Arabic) - Role-based access control - Real-time chat interface with loading states 🔧 Technical Improvements: - Fixed all linter errors and TypeScript issues - Cleaned up codebase and removed legacy files - Added comprehensive .gitignore - Updated README with detailed setup instructions - Optimized database schema and migrations - Enhanced error handling and user experience 📚 Documentation: - AI Conversation Memory Guide - AI Enhancement Summary - Developer Guide - User Guide - Complete setup and deployment instructions 🚀 Ready for GitHub deployment and production use!
28 lines
670 B
TypeScript
28 lines
670 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
import { deleteUserSession } from '@/lib/auth';
|
|
import { cookies } from 'next/headers';
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
const cookieStore = await cookies();
|
|
const token = cookieStore.get('auth-token')?.value;
|
|
|
|
if (token) {
|
|
await deleteUserSession(token);
|
|
}
|
|
|
|
// Clear cookie
|
|
cookieStore.delete('auth-token');
|
|
|
|
return NextResponse.json({
|
|
message: 'Logout successful',
|
|
});
|
|
|
|
} catch (error) {
|
|
console.error('Logout error:', error);
|
|
return NextResponse.json(
|
|
{ error: 'Internal server error' },
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
}
|