Return unauthorised instead of forbidden

This commit is contained in:
Neil Alexander 2020-12-18 14:36:43 +00:00
parent fed8ccc3da
commit cb9f319e11
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -590,7 +590,10 @@ func handleRegistrationFlow(
// TODO: email / msisdn auth types. // TODO: email / msisdn auth types.
accessToken, accessTokenErr := auth.ExtractAccessToken(req) accessToken, accessTokenErr := auth.ExtractAccessToken(req)
if accessTokenErr != nil { if accessTokenErr != nil {
return util.MessageResponse(http.StatusForbidden, "Access token error: "+accessTokenErr.Error()) return util.JSONResponse{
Code: http.StatusUnauthorized,
JSON: jsonerror.MissingToken(accessTokenErr.Error()),
}
} }
// Appservices are special and are not affected by disabled // Appservices are special and are not affected by disabled