Prepare Kalendartool for MPM and disable invites

This commit is contained in:
Kühn
2026-10-08 15:06:22 +02:00
parent bc49c3074e
commit 556202575e
50 changed files with 905 additions and 836 deletions

View File

@@ -11,6 +11,7 @@
* Der Zustand wird in localStorage persistiert, damit die Wahl
* ueber Seitenwechsel hinweg erhalten bleibt.
*/
import { appFetch } from '@/lib/client-fetch';
import { useEffect, useState } from 'react';
import Link from 'next/link';
import { usePathname, useRouter } from 'next/navigation';
@@ -115,7 +116,7 @@ export function Sidebar({
async function logout() {
setIsLoggingOut(true);
try {
await fetch('/api/auth/logout', { method: 'POST' });
await appFetch('/api/auth/logout', { method: 'POST' });
router.push('/login');
router.refresh();
} finally {
@@ -140,7 +141,7 @@ export function Sidebar({
Kalendartool
</span>
)}
<button
{process.env.NEXT_PUBLIC_MPM_AUTH_MODE !== 'true' && <button
type="button"
onClick={toggleCollapsed}
aria-expanded={!isCollapsed}
@@ -148,7 +149,7 @@ export function Sidebar({
className="rounded-md p-2 text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-slate-800 dark:hover:text-slate-200"
>
{isCollapsed ? '»' : '«'}
</button>
</button>}
</div>
<nav className="flex-1 space-y-1 overflow-y-auto p-2">
@@ -231,4 +232,4 @@ export function Sidebar({
)}
</aside>
);
}
}