Add locale param to sign-up API (#9747)

Fix #9627
This commit is contained in:
Eugen Rochko 2019-01-07 14:50:20 +01:00 committed by GitHub
parent 0a4caa89c3
commit 43c61bca60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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))