Closed bronzdoc closed 1 year ago
I was able to override it after wrapping the configuration in Rails.application.after_initialize
Rails.application.config.after_initialize do
OmniAuth.config.on_failure = Proc.new do |env|
# Handle error....
end
end
Environment
Current behavior
Is there a way to override the configuration in
/lib/devise/omniauth.rb
?I'm working with an Auth0 password rotation action that gives me an
OmniAuth::Strategies::OAuth2::CallbackError
error, whenever a user has an expired password, the way to handle this error is defining andon_failure
block but with the defaulton_failure
defined in/lib/devise/omniauth.rb
I'm getting an unexpected behavior:Error happens here https://github.com/heartcombo/devise/blob/8b0b849a67c46b10827743aa0ccb0679d69e5396/lib/devise/omniauth.rb#L16
I have tried to override it in an initializer with no luck:
config/initializers/omniauth.rb
Expected behavior
Be able to override
on_failure
in/lib/devise/omniauth.rb