mirror of
https://github.com/omniauth/omniauth.git
synced 2022-11-09 12:31:49 -05:00
Set origin when mocking a failure
This commit is contained in:
parent
e1408f50ab
commit
32eed3b617
1 changed files with 2 additions and 2 deletions
|
@ -278,14 +278,14 @@ module OmniAuth
|
||||||
|
|
||||||
def mock_callback_call
|
def mock_callback_call
|
||||||
setup_phase
|
setup_phase
|
||||||
|
@env['omniauth.origin'] = session.delete('omniauth.origin')
|
||||||
|
@env['omniauth.origin'] = nil if env['omniauth.origin'] == ''
|
||||||
mocked_auth = OmniAuth.mock_auth_for(name.to_s)
|
mocked_auth = OmniAuth.mock_auth_for(name.to_s)
|
||||||
if mocked_auth.is_a?(Symbol)
|
if mocked_auth.is_a?(Symbol)
|
||||||
fail!(mocked_auth)
|
fail!(mocked_auth)
|
||||||
else
|
else
|
||||||
@env['omniauth.auth'] = mocked_auth
|
@env['omniauth.auth'] = mocked_auth
|
||||||
@env['omniauth.params'] = session.delete('omniauth.params') || {}
|
@env['omniauth.params'] = session.delete('omniauth.params') || {}
|
||||||
@env['omniauth.origin'] = session.delete('omniauth.origin')
|
|
||||||
@env['omniauth.origin'] = nil if env['omniauth.origin'] == ''
|
|
||||||
OmniAuth.config.before_callback_phase.call(@env) if OmniAuth.config.before_callback_phase
|
OmniAuth.config.before_callback_phase.call(@env) if OmniAuth.config.before_callback_phase
|
||||||
call_app!
|
call_app!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue