add logging for failed auth
All checks were successful
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 1m15s
All checks were successful
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 1m15s
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"api/src/utils"
|
"api/src/utils"
|
||||||
|
|
||||||
"context"
|
"context"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -23,6 +24,7 @@ func EnsureAuth(next http.Handler) http.Handler {
|
|||||||
|
|
||||||
token, err := utils.VerifyToken(tokenStr)
|
token, err := utils.VerifyToken(tokenStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user