File tree Expand file tree Collapse file tree 2 files changed +23
-28
lines changed
Expand file tree Collapse file tree 2 files changed +23
-28
lines changed Original file line number Diff line number Diff line change @@ -110,22 +110,20 @@ def status_message
110110 def validate ( collect_errors = false )
111111 reset_errors!
112112
113- if collect_errors
114- valid_state?
115- validate_success_status
116- validate_structure
117- valid_in_response_to?
118- valid_issuer?
119- validate_signature
113+ validations = [
114+ :valid_state? ,
115+ :validate_success_status ,
116+ :validate_structure ,
117+ :valid_in_response_to? ,
118+ :valid_issuer? ,
119+ :validate_signature
120+ ]
120121
122+ if collect_errors
123+ validations . each { |validation | send ( validation ) }
121124 @errors . empty?
122125 else
123- valid_state? &&
124- validate_success_status &&
125- validate_structure &&
126- valid_in_response_to? &&
127- valid_issuer? &&
128- validate_signature
126+ validations . all? { |validation | send ( validation ) }
129127 end
130128 end
131129
Original file line number Diff line number Diff line change @@ -126,24 +126,21 @@ def session_indexes
126126 def validate ( collect_errors = false )
127127 reset_errors!
128128
129- if collect_errors
130- validate_request_state
131- validate_id
132- validate_version
133- validate_structure
134- validate_not_on_or_after
135- validate_issuer
136- validate_signature
129+ validations = [
130+ :validate_request_state ,
131+ :validate_id ,
132+ :validate_version ,
133+ :validate_structure ,
134+ :validate_not_on_or_after ,
135+ :validate_issuer ,
136+ :validate_signature
137+ ]
137138
139+ if collect_errors
140+ validations . each { |validation | send ( validation ) }
138141 @errors . empty?
139142 else
140- validate_request_state &&
141- validate_id &&
142- validate_version &&
143- validate_structure &&
144- validate_not_on_or_after &&
145- validate_issuer &&
146- validate_signature
143+ validations . all? { |validation | send ( validation ) }
147144 end
148145 end
149146
You can’t perform that action at this time.
0 commit comments