2013-01-07 09:04:09 +01:00
|
|
|
class RegistrationsController < Devise::RegistrationsController
|
2014-05-16 20:31:41 +02:00
|
|
|
before_action :configure_permitted_parameters, if: :devise_controller?
|
|
|
|
|
|
2014-06-18 16:58:30 +03:00
|
|
|
def edit
|
|
|
|
|
@openids = Openid.where(user_id: current_user.id).order(:provider)
|
2014-11-04 17:42:47 +01:00
|
|
|
super
|
2014-06-18 16:58:30 +03:00
|
|
|
end
|
|
|
|
|
|
2013-01-07 09:04:09 +01:00
|
|
|
def update
|
2014-06-26 15:43:24 +03:00
|
|
|
@openids = Openid.where(user_id: current_user.id).order(:provider)
|
2014-11-04 17:42:47 +01:00
|
|
|
super
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
|
|
def after_update_path_for(resource)
|
|
|
|
|
edit_user_registration_path(resource)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def after_sign_up_path_for(resource)
|
|
|
|
|
edit_user_registration_path(resource)
|
|
|
|
|
end
|
|
|
|
|
|
2014-05-16 20:31:41 +02:00
|
|
|
def configure_permitted_parameters
|
|
|
|
|
devise_parameter_sanitizer.for(:account_update) do |u|
|
|
|
|
|
u.
|
2017-02-14 17:54:31 +03:00
|
|
|
permit(:email, :password, :password_confirmation, :current_password, :username, :email_public)
|
2014-06-23 19:07:50 +03:00
|
|
|
end
|
|
|
|
|
devise_parameter_sanitizer.for(:sign_up) do |u|
|
|
|
|
|
u.
|
2014-11-03 15:25:33 +01:00
|
|
|
permit(:email, :password, :password_confirmation, :name, :username)
|
2014-05-16 20:31:41 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|