about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-07 14:50:20 +0100
committerGitHub <noreply@github.com>2019-01-07 14:50:20 +0100
commit43c61bca60016cad5d3fae210fd57622b40225a8 (patch)
tree9529491545d4a340d63308105877963a54848b64
parent0a4caa89c364fb9dcec966166e4bc9620ddf1013 (diff)
Add locale param to sign-up API (#9747)
Fix #9627
-rw-r--r--app/controllers/api/v1/accounts_controller.rb2
-rw-r--r--app/services/app_sign_up_service.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb
index 6e4084c4e..2ccbc3cbb 100644
--- a/app/controllers/api/v1/accounts_controller.rb
+++ b/app/controllers/api/v1/accounts_controller.rb
@@ -76,7 +76,7 @@ class Api::V1::AccountsController < Api::BaseController
   end
 
   def account_params
-    params.permit(:username, :email, :password, :agreement)
+    params.permit(:username, :email, :password, :agreement, :locale)
   end
 
   def check_enabled_registrations
diff --git a/app/services/app_sign_up_service.rb b/app/services/app_sign_up_service.rb
index 1878587e8..d621cc462 100644
--- a/app/services/app_sign_up_service.rb
+++ b/app/services/app_sign_up_service.rb
@@ -4,7 +4,7 @@ class AppSignUpService < BaseService
   def call(app, params)
     return unless allowed_registrations?
 
-    user_params    = params.slice(:email, :password, :agreement)
+    user_params    = params.slice(:email, :password, :agreement, :locale)
     account_params = params.slice(:username)
     user           = User.create!(user_params.merge(created_by_application: app, password_confirmation: user_params[:password], account_attributes: account_params))