Skip to content

Commit

Permalink
fb_graph 1.7.0.alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
nov committed Apr 22, 2011
1 parent 4ca9cc8 commit 0d3edc7
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,3 @@
db/*.sqlite3
log/*.log
tmp/**/*
Gemfile.lock
3 changes: 1 addition & 2 deletions Gemfile
Expand Up @@ -2,5 +2,4 @@ source 'http://rubygems.org'

gem 'rails', '3.0.6'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'fb_graph', '>=1.6.5'
gem 'rack-oauth2', '>=0.5.1'
gem 'fb_graph', '>=1.7.0.alpha2'
91 changes: 91 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,91 @@
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.6)
actionpack (= 3.0.6)
mail (~> 2.2.15)
actionpack (3.0.6)
activemodel (= 3.0.6)
activesupport (= 3.0.6)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.6)
activesupport (= 3.0.6)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.6)
activemodel (= 3.0.6)
activesupport (= 3.0.6)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activeresource (3.0.6)
activemodel (= 3.0.6)
activesupport (= 3.0.6)
activesupport (3.0.6)
arel (2.0.9)
attr_required (0.0.3)
builder (2.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
fb_graph (1.7.0.alpha2)
rack-oauth2 (>= 0.6.5)
i18n (0.5.0)
json (1.5.1)
mail (2.2.17)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
polyglot (0.3.1)
rack (1.2.2)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-oauth2 (0.6.5)
activesupport (>= 2.3)
attr_required (>= 0.0.3)
i18n
json (>= 1.4.3)
rack (>= 1.1)
restclient_with_cert
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.6)
actionmailer (= 3.0.6)
actionpack (= 3.0.6)
activerecord (= 3.0.6)
activeresource (= 3.0.6)
activesupport (= 3.0.6)
bundler (~> 1.0)
railties (= 3.0.6)
railties (3.0.6)
actionpack (= 3.0.6)
activesupport (= 3.0.6)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
rest-client (1.6.1)
mime-types (>= 1.16)
restclient_with_cert (0.0.5)
rest-client (>= 1.6)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.26)

PLATFORMS
ruby

DEPENDENCIES
fb_graph (>= 1.7.0.alpha2)
rails (= 3.0.6)
sqlite3-ruby
14 changes: 6 additions & 8 deletions app/controllers/facebooks_controller.rb
Expand Up @@ -20,7 +20,7 @@ def new
# handle Normal OAuth flow: callback
def create
client.authorization_code = params[:code]
access_token = client.access_token![:access_token]
access_token = client.access_token!
user = FbGraph::User.me(access_token).fetch
authenticate Facebook.identify(user)
redirect_to dashboard_url
Expand All @@ -34,13 +34,11 @@ def destroy
private

def client
@client ||= Rack::OAuth2::Client.new(
:identifier => Facebook.config[:client_id],
:secret => Facebook.config[:client_secret],
:redirect_uri => callback_facebook_url,
:authorization_endpoint => 'https://www.facebook.com/dialog/oauth',
:token_endpoint => 'https://graph.facebook.com/oauth/access_token'
)
unless @client
@client = Facebook.auth.client
@client.redirect_uri = callback_facebook_url
end
@client
end

end

0 comments on commit 0d3edc7

Please sign in to comment.