Debug-Schritte entfernt
All checks were successful
release-tag / release-image (push) Successful in 2m13s

This commit is contained in:
2025-07-31 23:13:52 +02:00
parent 842c541c13
commit 134e601d57

View File

@@ -195,13 +195,10 @@ func reverse(s string) string {
func isAuthenticated(r *http.Request) bool {
cookie, err := r.Cookie("session")
if err != nil {
fmt.Println("Debug-1:", err)
return false
}
// Prüfen, ob der Token im sessionStore existiert
a, ok := sessionStore[cookie.Value]
fmt.Println(ok, a)
fmt.Println(sessionStore)
_, ok := sessionStore[cookie.Value]
return ok
}
@@ -306,7 +303,6 @@ func main() {
// Speichere Session
sessionStore[token] = user
fmt.Println("Login", token)
// Cookie setzen
http.SetCookie(w, &http.Cookie{
@@ -351,7 +347,6 @@ func main() {
cookie, err := r.Cookie("session")
if err == nil {
token := cookie.Value
fmt.Println("Logout", token)
// Token aus dem serverseitigen Store löschen
delete(sessionStore, token)