Logout-Button in Navigation

This commit is contained in:
oswaldsimona committed 2026-04-20 22:18:14 +02:00
1 parent 28e1647749
commit 540754d7d0
8 files changed
+39 -45

No files matched your search

+3 -3
View File
@@ -386,9 +386,9 @@ function buildMenuItems(value) {
*/
function mapEventTypeToCategory(value) {
const categoryMap = {
Brunch: "BRUNCH",
Lunch: "LUNCH",
Dinner: "DINNER",
Brunch: "Brunch",
Lunch: "Lunch",
Dinner: "Dinner",
"Kaffee + Kuchen": "COFFEE"
};
+13
View File
@@ -25,6 +25,12 @@ document.addEventListener('DOMContentLoaded', () => {
}
}
// Logout-Funktion
window.logout = function() {
localStorage.removeItem(CURRENT_USER_KEY);
window.location.href = 'index.html';
};
// Baut die Navigation für ausgeloggte Besucher.
function buildLoggedOutNavigation() {
const loginIsActive = currentPage === 'login.html';
@@ -85,6 +91,13 @@ document.addEventListener('DOMContentLoaded', () => {
>
Event erstellen
</a>
<button
class="button-small logout-button"
onclick="logout()"
aria-label="Logout"
>
Logout
</button>
<a
class="profile-pill"
href="my_profil.html"