Remove auth token query param fallback

This commit is contained in:
Marcus Kida 2026-02-10 11:01:41 +01:00
parent 5467bd4f01
commit c10615a164

View file

@ -10,13 +10,7 @@ import (
func adminAuth(token string, next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
auth := r.Header.Get("Authorization")
if auth == "Bearer "+token {
next.ServeHTTP(w, r)
return
}
// For the HTML page, allow token via query param so it can be bookmarked
if r.URL.Query().Get("token") == token {
if r.Header.Get("Authorization") == "Bearer "+token {
next.ServeHTTP(w, r)
return
}