Skip to content

Commit

Permalink
Merge pull request #1864 from internetee/fix-registrant-api-country-code
Browse files Browse the repository at this point in the history
Registrant API Auth: Permit country_code param
  • Loading branch information
vohmar authored Feb 26, 2021
2 parents 5bf2bf0 + 40b7897 commit 673b3b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/registrant/auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def eid_params
obj.require(key)
end

params.permit(required_params)
params.permit(required_params + [:country_code])
end

def create_token(user)
Expand Down
2 changes: 1 addition & 1 deletion app/models/registrant_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def find_or_create_by_api_data(user_data = {})
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
Expand Down

0 comments on commit 673b3b7

Please sign in to comment.