fix: resolve linting errors
- Remove unused parameters in logout route - Remove unused AnimatePresence import - Remove unused handleLogout function
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
export async function POST() {
|
||||
try {
|
||||
// Simple logout - just return success
|
||||
// The client will handle clearing the session storage
|
||||
@@ -16,7 +16,7 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return new NextResponse(
|
||||
JSON.stringify({ error: 'Logout failed' }),
|
||||
{ status: 500, headers: { 'Content-Type': 'application/json' } }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Lock, Loader2 } from 'lucide-react';
|
||||
import ModernAdminDashboard from '@/components/ModernAdminDashboard';
|
||||
|
||||
@@ -157,18 +157,6 @@ const AdminPage = () => {
|
||||
}
|
||||
}, [authState.csrfToken, authState.isLocked, checkSession]);
|
||||
|
||||
// Handle logout
|
||||
const handleLogout = useCallback(() => {
|
||||
sessionStorage.removeItem('admin_authenticated');
|
||||
sessionStorage.removeItem('admin_session_token');
|
||||
setAuthState(prev => ({
|
||||
...prev,
|
||||
isAuthenticated: false,
|
||||
showLogin: true,
|
||||
password: '',
|
||||
error: ''
|
||||
}));
|
||||
}, []);
|
||||
|
||||
// Handle login form submission
|
||||
const handleLogin = async (e: React.FormEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user