Skip to content

Commit

Permalink
fix: missing username during register user
Browse files Browse the repository at this point in the history
fixes #1479
  • Loading branch information
icyleaf committed Apr 29, 2024
1 parent 80ffd9f commit f933066
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ApplicationController < ActionController::Base

around_action :set_locale
before_action :set_sentry_context
before_action :configure_permitted_parameters, if: :devise_controller?

def raise_not_found
raise ActionController::RoutingError, t('errors.messages.not_match_url', url: params[:unmatched_route])
Expand All @@ -34,4 +35,11 @@ def set_sentry_context
Sentry.set_user(id: current_user)
end
end

DEVISE_PERMITTED_PARAMTERS = %i[ username email password password_confirmation remember_me ]
def configure_permitted_parameters
devise_parameter_sanitizer.permit :sign_up, keys: DEVISE_PERMITTED_PARAMTERS
devise_parameter_sanitizer.permit :account_update, keys: DEVISE_PERMITTED_PARAMTERS
devise_parameter_sanitizer.permit :sign_in, keys: %i[ username email password ]
end
end

0 comments on commit f933066

Please sign in to comment.