- Fixed authentication system (removed HTTP Basic Auth popup) - Added session-based authentication with proper logout - Updated rate limiting (20 req/s for login, 5 req/m for admin) - Created production deployment scripts and configs - Updated nginx configuration for dk0.dev domain - Added comprehensive production deployment guide - Fixed logout button functionality - Optimized for production with proper resource limits
26 lines
750 B
TypeScript
26 lines
750 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
// Simple logout - just return success
|
|
// The client will handle clearing the session storage
|
|
return new NextResponse(
|
|
JSON.stringify({ success: true, message: 'Logged out successfully' }),
|
|
{
|
|
status: 200,
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
'Pragma': 'no-cache',
|
|
'Expires': '0'
|
|
}
|
|
}
|
|
);
|
|
} catch (error) {
|
|
return new NextResponse(
|
|
JSON.stringify({ error: 'Logout failed' }),
|
|
{ status: 500, headers: { 'Content-Type': 'application/json' } }
|
|
);
|
|
}
|
|
}
|