Authlogic Facebook find existing account
Posted
by pcasa
on Stack Overflow
See other posts from Stack Overflow
or by pcasa
Published on 2010-05-25T19:01:14Z
Indexed on
2010/05/25
20:11 UTC
Read the original article
Hit count: 268
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
© Stack Overflow or respective owner