Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellhenke committed Oct 6, 2023
1 parent 8c080db commit 3d21e54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/forms/webauthn_verification_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def self.domain_name

def validate_assertion_response
return if webauthn_error.present? || webauthn_configuration.blank? || valid_assertion_response?
errors.add(:authenticator_data, :invalid, type: :invalid)
errors.add(:authenticator_data, 'invalid_authenticator_data', type: :invalid_authenticator_data)
end

def validate_webauthn_error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
result = { context: 'authentication',
multi_factor_auth_method: 'webauthn',
success: false,
error_details: { authenticator_data: [:invalid] },
error_details: { authenticator_data: ['invalid_authenticator_data'] },
webauthn_configuration_id: webauthn_configuration.id,
multi_factor_auth_method_created_at: webauthn_configuration.created_at.
strftime('%s%L') }
Expand Down
12 changes: 6 additions & 6 deletions spec/forms/webauthn_verification_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
success: false,
error_details: {
challenge: [:blank],
authenticator_data: [:invalid],
authenticator_data: ['invalid_authenticator_data'],
},
multi_factor_auth_method: 'webauthn',
webauthn_configuration_id: webauthn_configuration.id,
Expand All @@ -98,7 +98,7 @@
expect(result.to_h).to eq(
success: false,
error_details: {
authenticator_data: [:blank, :invalid],
authenticator_data: [:blank, 'invalid_authenticator_data'],
},
multi_factor_auth_method: 'webauthn',
webauthn_configuration_id: webauthn_configuration.id,
Expand All @@ -114,7 +114,7 @@
success: false,
error_details: {
client_data_json: [:blank],
authenticator_data: [:invalid],
authenticator_data: ['invalid_authenticator_data'],
},
multi_factor_auth_method: 'webauthn',
webauthn_configuration_id: webauthn_configuration.id,
Expand All @@ -130,7 +130,7 @@
success: false,
error_details: {
signature: [:blank],
authenticator_data: [:invalid],
authenticator_data: ['invalid_authenticator_data'],
},
multi_factor_auth_method: 'webauthn',
webauthn_configuration_id: webauthn_configuration.id,
Expand Down Expand Up @@ -172,7 +172,7 @@
it 'returns unsuccessful result' do
expect(result.to_h).to eq(
success: false,
error_details: { authenticator_data: [:invalid] },
error_details: { authenticator_data: ['invalid_authenticator_data'] },
multi_factor_auth_method: 'webauthn',
webauthn_configuration_id: webauthn_configuration.id,
)
Expand All @@ -188,7 +188,7 @@
it 'returns unsucessful result' do
expect(result.to_h).to eq(
success: false,
error_details: { authenticator_data: [:invalid] },
error_details: { authenticator_data: ['invalid_authenticator_data'] },
multi_factor_auth_method: 'webauthn',
webauthn_configuration_id: webauthn_configuration.id,
)
Expand Down

0 comments on commit 3d21e54

Please sign in to comment.