Browse Source

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

Fix #9627
pull/4/head
Eugen Rochko 5 years ago
committed by GitHub
parent
commit
43c61bca60
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/controllers/api/v1/accounts_controller.rb
  2. +1
    -1
      app/services/app_sign_up_service.rb

+ 1
- 1
app/controllers/api/v1/accounts_controller.rb 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

+ 1
- 1
app/services/app_sign_up_service.rb 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))

Loading…
Cancel
Save