闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
571 B

  1. # frozen_string_literal: true
  2. class Auth::RegistrationsController < Devise::RegistrationsController
  3. layout 'auth'
  4. before_action :configure_sign_up_params, only: [:create]
  5. protected
  6. def build_resource(hash = nil)
  7. super(hash)
  8. resource.build_account if resource.account.nil?
  9. end
  10. def configure_sign_up_params
  11. devise_parameter_sanitizer.permit(:sign_up) do |u|
  12. u.permit({ account_attributes: [:username] }, :email, :password, :password_confirmation)
  13. end
  14. end
  15. def after_sign_up_path_for(_resource)
  16. new_user_session_path
  17. end
  18. end