add logging for failed auth

This commit is contained in:
2024-07-30 09:30:56 +02:00
parent 6b3ec35a97
commit df3fadba34

View File

@@ -4,6 +4,7 @@ import (
"api/src/utils"
"context"
"log"
"net/http"
)
@@ -23,6 +24,7 @@ func EnsureAuth(next http.Handler) http.Handler {
token, err := utils.VerifyToken(tokenStr)
if err != nil {
log.Println(err)
http.Error(w, "Unauthorized", http.StatusUnauthorized)
return
}