This commit is contained in:
lbenedar
2026-03-20 18:27:16 +03:00
parent 891b63f259
commit 928870be1c
3 changed files with 42 additions and 5 deletions

View File

@@ -68,3 +68,13 @@ func (app *application) invalidAuthenticationTokenResponse(w http.ResponseWriter
message := "invalid or missing authentication token"
app.errorResponse(w, r, http.StatusUnauthorized, message)
}
func (app *application) authenticationRequiredResponse(w http.ResponseWriter, r *http.Request) {
message := "you must be authenticated to access this resource"
app.errorResponse(w, r, http.StatusUnauthorized, message)
}
func (app *application) inactiveAccountResponse(w http.ResponseWriter, r *http.Request) {
message := "your user account must be activated to access this resource"
app.errorResponse(w, r, http.StatusForbidden, message)
}