Ahmad Al-kheat
Ahmad Al-kheat

Reputation: 1795

devise+omniauth-facebook, where can I find the auth hash?

I need to change the image size, so where can I find that hash that contains all the info returned? I am using devise Thanks

Upvotes: 0

Views: 80

Answers (1)

Raza
Raza

Reputation: 2388

auth hash is stored in env["omniauth.auth"], look for it in your callback controller

data = request.env["omniauth.auth"]

this data contains all your info. Facebook provides 4 sizes for image small, square, large, normal. And you can set the default size for image in config/initializers/omniauth.rb as,

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'], :image_size => 'large'
end

Update: If you are using devise, check in your app/config/initializers/devise.rb

 Devise.setup do |config|
...
  config.omniauth :facebook,  ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'], :image_size => 'large'
...
end

Upvotes: 1

Related Questions