Bug behoben: Wenn Einträge bearbeitet werden, wird man visuell abgemeldet. Das stimmt jedoch nicht, und mit eine F5 ist man wieder angemeldet.
All checks were successful
release-tag / release-image (push) Successful in 2m30s

This commit is contained in:
2025-08-01 21:00:10 +02:00
parent 134e601d57
commit ff2f37f718
2 changed files with 5 additions and 1 deletions

View File

@@ -401,6 +401,7 @@ func main() {
})
http.HandleFunc("/markaspaid", func(w http.ResponseWriter, r *http.Request) {
fmt.Println("Method", "/markaspaid", r.Method)
if !isAuthenticated(r) {
http.Error(w, "Nicht autorisiert", http.StatusUnauthorized)
return
@@ -419,6 +420,7 @@ func main() {
})
http.HandleFunc("/unmarkaspaid", func(w http.ResponseWriter, r *http.Request) {
fmt.Println("Method", "/unmarkaspaid", r.Method)
if !isAuthenticated(r) {
http.Error(w, "Nicht autorisiert", http.StatusUnauthorized)
return
@@ -437,6 +439,7 @@ func main() {
})
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Println("Method", "/", r.Method)
if r.Method == http.MethodPost {
if !isAuthenticated(r) {
http.Error(w, "Nicht autorisiert", http.StatusUnauthorized)
@@ -474,6 +477,7 @@ func main() {
cachedData := cache.Data
cacheMutex.RUnlock()
fmt.Println("validCache:", validCache)
if validCache {
cachedData.LoggedIn = isAuthenticated(r)
tmpl.Execute(w, cachedData)
@@ -630,7 +634,7 @@ func main() {
cache.Data = computed
cache.LastComputed = time.Now()
cacheMutex.Unlock()
computed.LoggedIn = isAuthenticated(r)
tmpl.Execute(w, computed)
/*tmpl.Execute(w, struct {