Permalink
Browse files

Bumped several vesions and updated readme

  • Loading branch information...
1 parent 22a8e06 commit b51535feeb39973340e8a42537de561ab77ac837 @james2m committed Dec 31, 2010
Showing with 58 additions and 6 deletions.
  1. +55 −4 README.rdoc
  2. +1 −1 VERSION
  3. +2 −1 authlogic_facebook_koala.gemspec
View
59 README.rdoc
@@ -4,11 +4,62 @@ This is a plugin for integrating facebook sessions into authlogic.
This requires a config/facebook.yml file that looks like this:
- development:
- app_id: xxx123xxx
+ development:
+ app_id: appid
+ api_key: apikey
+ secret_key: secretkey
+
+ production:
+ app_id: appid
+ api_key: apikey
+ secret_key: secretkey
+
+If you don't have different facebook credentials for different environments you can set these in UserSession
+
+ facebook_app_id 'appid'
+ facebook_api_key 'apikey'
+ facebook_secret_key 'secretkey'
+
+In your controller you probably have something like this;
+
+ def current_user_session
+ @current_user_session ||= AccountSession.find
+ end
+
+ def current_user
+ @current_user ||= current_user_session.try(:user)
+ end
+
+ def logged_in?
+ current_user && !current_user_session.stale?
+ end
+
+To get hold of the facebook particulars you will need to add something like this;
+
+ def facebook_user
+ current_user_session.try(:facebook_user)
+ end
+
+ def facebook_user?
+ !facebook_user.nil?
+ end
+
+ def facebook_session?
+ current_user_session.try(:facebook_session?)
+ end
+
+If you have conventional signin and want to ignore facebook for it you will need to do this in your user_sessions_controller;
+
+ def create
+ @account_session = AccountSession.new(params[:account_session])
+ @account_session.skip_facebook_authentication = true
+ if @account_session.save
+ redirect_to member_home_path
+ else
+ render :action => :new
+ end
+ end
- production:
- app_id: xxx123xxx
== Note on Patches/Pull Requests
View
2 VERSION
@@ -1 +1 @@
-0.0.2
+0.3.0
View
3 authlogic_facebook_koala.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = %q{authlogic_facebook_koala}
- s.version = "0.0.2"
+ s.version = "0.3.0"
s.required_rubygems_version = Gem::Requirement.new(">=1.2.0") if s.respond_to? :required_rubygems_version=
s.authors = ["James McCarthy"]
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('authlogic', ">= 2.1.3")
s.add_runtime_dependency('koala', ">= 0.7.1")
s.add_development_dependency('rails', '=2.3.5')
+ s.add_development_dependency('flexmock')
s.add_development_dependency('jeweler')
s.add_development_dependency('shoulda')
s.add_development_dependency('sqlite3-ruby')

0 comments on commit b51535f

Please sign in to comment.