logout - sidebar
This commit is contained in:
@@ -238,9 +238,8 @@ export function EPDSidebar({ className = "", userEmail, userName }: EPDSidebarPr
|
||||
|
||||
{/* Logout Button */}
|
||||
<div className="p-3">
|
||||
<form action="/auth/logout" method="POST">
|
||||
<button
|
||||
type="submit"
|
||||
onClick={() => window.location.href = '/auth/logout'}
|
||||
className={`
|
||||
w-full flex items-center rounded-md text-left transition-all duration-200 group
|
||||
text-red-600 hover:bg-red-50 hover:text-red-700
|
||||
@@ -264,7 +263,6 @@ export function EPDSidebar({ className = "", userEmail, userName }: EPDSidebarPr
|
||||
</div>
|
||||
)}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -63,6 +63,10 @@ export function Sidebar({ className = "" }: SidebarProps) {
|
||||
const toggleCollapse = () => setIsCollapsed(!isCollapsed);
|
||||
|
||||
const handleItemClick = (itemId: string) => {
|
||||
if (itemId === 'logout') {
|
||||
window.location.href = '/auth/logout';
|
||||
return;
|
||||
}
|
||||
setActiveItem(itemId);
|
||||
if (window.innerWidth < 768) {
|
||||
setIsOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user