I've been using https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview to get facebook authentication to work. I did everything that it told me to do, but it still doesn't work. I got a Cookie overflow error initially, so after doing some googling, I added except('extra') in the omniauth_callbacks_controller.rb like below
session["devise.facebook_data"] = request.env["omniauth.auth"].except('extra')
That got rid of the error, but it still doesn't log the user in. In fact, I don't even think it creates the user (checked with heroku rails c).
It gives me back a url with "sign_up#=" appended to the back of it. What might be the problem?
user = User.create(name:auth.extra.raw_info.name,
provider:auth.provider,
uid:auth.uid,
email:auth.info.email,
username:auth.info.email,
password:Devise.friendly_token[0,20]
)
I added "username," as I use that in my User model, but I can't seem to think of anything else that I might need to edit/add.
Rails 3.1.3, Ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.1]
===============quick update ===========================
So it looks like I got the user to save - I can see it in the database. However, it still doesn't log the user in, and I can't log in with that created user since I only know the username and email, and not the password. In short, I got Facebook to send me the info and I was able to save it to the db, but not redirect to a logged in screen.