summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-07-10 19:31:05 +0200
committerMarin Jankovski <marin@gitlab.com>2014-07-10 19:31:05 +0200
commit60cc1d8e92ad7d2be9f452cbbce8b583bc87056f (patch)
tree132f41fa930bdfbbe1d6160827cc453412a268e2
parent108be8a666d7478e78c39c8e4e54db622f0e58dc (diff)
downloadgitlab-ce-60cc1d8e92ad7d2be9f452cbbce8b583bc87056f.tar.gz
Override strong params for sign up.
-rw-r--r--app/controllers/application_controller.rb1
-rw-r--r--app/controllers/registrations_controller.rb4
2 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index fbfc356ae60..1feeb601d36 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -247,7 +247,6 @@ class ApplicationController < ActionController::Base
def configure_permitted_parameters
devise_parameter_sanitizer.sanitize(:sign_in) { |u| u.permit(:username, :email, :password, :login, :remember_me) }
- devise_parameter_sanitizer.sanitize(:sign_up) { |u| u.permit(:username, :email, :name, :password, :password_confirmation) }
end
def hexdigest(string)
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 8dd1642c1d9..9e70978992f 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -28,4 +28,8 @@ class RegistrationsController < Devise::RegistrationsController
def signup_enabled?
redirect_to new_user_session_path unless Gitlab.config.gitlab.signup_enabled
end
+
+ def sign_up_params
+ params.require(:user).permit(:username, :email, :name, :password, :password_confirmation)
+ end
end