1
0
Fork 0
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:
Tom Hughes 2015-02-21 17:55:37 +00:00
parent e1408f50ab
commit 32eed3b617

View file

@ -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