default err code

This commit is contained in:
Denis Mishin 2025-04-23 22:15:58 -04:00
parent b9b1754fcd
commit d163af4d15

View file

@ -40,7 +40,7 @@ func (srv *Handler) Authorize(w http.ResponseWriter, r *http.Request) {
if err := oauth21.ValidateAuthorizationRequest(client, v); err != nil {
log.Ctx(ctx).Error().Err(err).Msg("failed to validate authorization request")
var ve oauth21.Error
ve := oauth21.Error{Code: oauth21.InvalidRequest}
_ = errors.As(err, &ve)
oauth21.ErrorResponse(w, http.StatusBadRequest, ve.Code)
return