better unauth message

This commit is contained in:
Evan Jarrett
2025-10-12 22:30:24 -05:00
parent 40a4017e23
commit 9a64804807
2 changed files with 7 additions and 9 deletions
+1 -3
View File
@@ -2,7 +2,7 @@
# Triggers on version tags and builds cross-platform binaries using GoReleaser
when:
- event: ["push"]
- event: ["manual"]
# TODO: Trigger only on version tags (v1.0.0, v2.1.3, etc.)
branch: ["main"]
@@ -29,5 +29,3 @@ steps:
- name: Run GoReleaser
command: goreleaser release --clean
environment:
REPO_URL
+6 -6
View File
@@ -69,8 +69,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
baseURL = "http://" + baseURL
}
}
w.Header().Set("WWW-Authenticate", fmt.Sprintf(`Basic realm="ATCR Registry - Visit %s/install to authenticate or use 'docker login' with your ATProto app-password"`, baseURL))
http.Error(w, "authentication required", http.StatusUnauthorized)
w.Header().Set("WWW-Authenticate", `Basic realm="ATCR Registry"`)
http.Error(w, fmt.Sprintf("authentication required - visit %s/install to authenticate or use 'docker login' with your ATProto app-password", baseURL), http.StatusUnauthorized)
return
}
@@ -114,8 +114,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
baseURL = "http://" + baseURL
}
}
w.Header().Set("WWW-Authenticate", fmt.Sprintf(`Basic realm="ATCR Registry - Visit %s/install to authenticate or use 'docker login' with your ATProto app-password"`, baseURL))
http.Error(w, "authentication failed", http.StatusUnauthorized)
w.Header().Set("WWW-Authenticate", `Basic realm="ATCR Registry"`)
http.Error(w, fmt.Sprintf("authentication failed - visit %s/install to authenticate or use 'docker login' with your ATProto app-password", baseURL), http.StatusUnauthorized)
return
}
@@ -142,8 +142,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
baseURL = "http://" + baseURL
}
}
w.Header().Set("WWW-Authenticate", fmt.Sprintf(`Basic realm="ATCR Registry - Visit %s/install to authenticate or use 'docker login' with your ATProto app-password"`, baseURL))
http.Error(w, fmt.Sprintf("authentication failed: %v", err), http.StatusUnauthorized)
w.Header().Set("WWW-Authenticate", `Basic realm="ATCR Registry"`)
http.Error(w, fmt.Sprintf("authentication failed - visit %s/install to authenticate or use 'docker login' with your ATProto app-password", baseURL), http.StatusUnauthorized)
return
}