This commit is contained in:
lbenedar
2026-03-20 18:07:41 +03:00
parent efb58d7c15
commit 891b63f259
5 changed files with 88 additions and 1 deletions

View File

@@ -61,3 +61,10 @@ func (app *application) invalidCredentialsResponse(w http.ResponseWriter, r *htt
message := "invalid authentication credentials"
app.errorResponse(w, r, http.StatusUnauthorized, message)
}
func (app *application) invalidAuthenticationTokenResponse(w http.ResponseWriter, r *http.Request) {
w.Header().Set("WWW-Authenticate", "Bearer")
message := "invalid or missing authentication token"
app.errorResponse(w, r, http.StatusUnauthorized, message)
}