From 9a64804807c848aaeb6efd250a5cac2a96d9552c Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Sun, 12 Oct 2025 22:30:24 -0500 Subject: [PATCH] better unauth message --- .tangled/workflows/release.yml | 4 +--- pkg/auth/token/handler.go | 12 ++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.tangled/workflows/release.yml b/.tangled/workflows/release.yml index ac69ef7..060c5ae 100644 --- a/.tangled/workflows/release.yml +++ b/.tangled/workflows/release.yml @@ -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 \ No newline at end of file diff --git a/pkg/auth/token/handler.go b/pkg/auth/token/handler.go index 79ac15f..2f6f09b 100644 --- a/pkg/auth/token/handler.go +++ b/pkg/auth/token/handler.go @@ -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 }