NET-163: Return 403 instead of 401 (#2326)

* return 401 instead of 403

* fixed http.StatusForbidden

* Tagged build version (temp)

* Unauthorized_Err when applicable

* untagged version
This commit is contained in:
Tobias Cudnik
2023-05-25 15:40:39 +02:00
committed by GitHub
parent 7b5bef7b3f
commit 3a4363c890
4 changed files with 13 additions and 9 deletions

View File

@@ -56,7 +56,7 @@ func getStatus(w http.ResponseWriter, r *http.Request) {
func allowUsers(next http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var errorResponse = models.ErrorResponse{
Code: http.StatusInternalServerError, Message: logic.Unauthorized_Msg,
Code: http.StatusInternalServerError, Message: logic.Forbidden_Msg,
}
bearerToken := r.Header.Get("Authorization")
var tokenSplit = strings.Split(bearerToken, " ")