Authlogic Facebook find existing account
- by pcasa
Using Authlogic and Authlogic Facebook Connect.
before_filter works great. Get name and facbook_uid saved in db. Only problem is that it saves a new record every time.
Need help figuring out how to build some type of find_by_facebook_uid_or_create_user
I have tried reading up on the API's for facebooker, but this is way over me. :(
UPDATED -
users_controller.rb
def before_connect(facebook_session)
self.firstname = facebook_session.user.first_name
self.lastname = facebook_session.user.last_name
self.persistence_token = reset_persistence_token
end
application_controller.rb
before_filter :set_facebook_session
helper_method :facebook_session