diff --git a/lib/u2f/register_response.rb b/lib/u2f/register_response.rb index da6fec9..2303694 100644 --- a/lib/u2f/register_response.rb +++ b/lib/u2f/register_response.rb @@ -20,6 +20,10 @@ def self.load_from_json(json) raise RegistrationError, code: data['errorCode'] end + if data['clientData'].blank? || data['registrationData'].blank? + raise RegistrationError, code: 2 + end + instance = new instance.client_data_json = ::U2F.urlsafe_decode64(data['clientData'])