intridea/omniauth — Issue #569: request.env['omniauth.origin'] => nil
Author: eagsalazar
Created: 2012-01-24 09:06:19+00:00
State: open

Hi, I have checked out these issue but am having the same problem:

https://github.com/intridea/omniauth/issues/227
https://github.com/intridea/omniauth/issues/483

Versions I'm using:
* omniauth (1.0.2)
* omniauth-facebook (1.0.0.rc2)
* omniauth-oauth (1.0.0)
* rack (1.3.3)
* rails (3.1.1)

Please let me know what other information you need.

```ruby
app/controllers/authentications_controller.rb @ line 31 in AuthenticationsController#failure:

26: @authentication.destroy
27: redirect_to edit_user_path(current_user), :notice => "Disconnected from #{provider}."
28: end
29:
30: def failure
=> 31: binding.pry
32: flash[:notice] = "Failed to connect to service."
33: if current_user
34: redirect_to edit_user_path(current_user)
35: else
36: redirect_to root_path
[1] pry(#)> request.env["rack.session"]["omniauth.origin"]
=> nil
[2] pry(#)> request.env["rack.session"]
=> {"session_id"=>"30262de6db88a559ee2927ef9cfed07d",
"_csrf_token"=>"B4xXH8HmB7jH9KAjvMsuHwe9auHVsF6uz783Cglh8fw=",
"oauth"=>{"twitter"=>{"callback_confirmed"=>true}}}
[3] pry(#)> env["action_dispatch.request.unsigned_session_cookie"]
=> {"session_id"=>"30262de6db88a559ee2927ef9cfed07d",
"_csrf_token"=>"B4xXH8HmB7jH9KAjvMsuHwe9auHVsF6uz783Cglh8fw=",
"oauth"=>{"twitter"=>{"callback_confirmed"=>true}}}
[4] pry(#)> request.env["action_dispatch.request.unsigned_session_cookie"]
=> {"session_id"=>"30262de6db88a559ee2927ef9cfed07d",
"_csrf_token"=>"B4xXH8HmB7jH9KAjvMsuHwe9auHVsF6uz783Cglh8fw=",
"oauth"=>{"twitter"=>{"callback_confirmed"=>true}}}
[5] pry(#)> request.env['omniauth.origin']
=> nil
```