You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a non-mocked scenario, before_request_phase is always called, as failure can only happen after the callback_call method calls callback_phase. When testing though, if we mock an auth failure via something like this:
OmniAuth.config.mock_auth[:auth0]=:access_denied
The before_request_phase hook is not called, resulting in a different outcome in tests vs. reality.
The change here seems pretty straightforward, but I wanted to confirm that this was not done on purpose. Is there a specific reason this hook should not be run in the mocked failure case?
The text was updated successfully, but these errors were encountered:
Configuration
omniauth-auth0
2.7.3
Rails 6.1.3.1
macOS
Expected Behavior
before_callback_phase
hook is invoked when mocking out a failed auth.Actual Behavior
before_callback_phase
hook is skipped due to lines 343-345 below:omniauth/lib/omniauth/strategy.rb
Lines 336 to 350 in a62d36b
Steps to Reproduce
In a non-mocked scenario,
before_request_phase
is always called, as failure can only happen after thecallback_call
method callscallback_phase
. When testing though, if we mock an auth failure via something like this:The
before_request_phase
hook is not called, resulting in a different outcome in tests vs. reality.The change here seems pretty straightforward, but I wanted to confirm that this was not done on purpose. Is there a specific reason this hook should not be run in the mocked failure case?
The text was updated successfully, but these errors were encountered: