fix(api): 401 on bad auth

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2023-01-31 19:09:17 +01:00
parent 33a2ce5bea
commit 3e839fdf5f
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD

View file

@ -52,6 +52,7 @@ func authFailed(w http.ResponseWriter, r *http.Request, realm string) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.Header().Set("X-Content-Type-Options", "nosniff")
w.Header().Add("WWW-Authenticate", fmt.Sprintf(`Realm="%s"`, realm))
w.WriteHeader(http.StatusUnauthorized)
resp := internal.Response{
Message: fmt.Sprintf(`Login failed -- Realm="%s"`, realm),