Merge pull request #1864 from internetee/fix-registrant-api-country-code

Registrant API Auth: Permit country_code param
This commit is contained in:
Timo Võhmar 2021-02-26 12:18:15 +02:00 committed by GitHub
commit 673b3b7e05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ module Api
obj.require(key)
end
params.permit(required_params)
params.permit(required_params + [:country_code])
end
def create_token(user)

View file

@ -76,7 +76,7 @@ class RegistrantUser < User
return false unless user_data[:last_name]
user_data[:country_code] ||= 'EE'
%i[ident country_code].each { |f| user_data[f].upcase! if user_data[f].is_a?(String) }
user_data[:country_code].upcase! if user_data[:country_code].is_a?(String)
find_or_create_by_user_data(user_data)
end