Class: FacebookOauthController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/facebook_oauth_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject

DELETE /facebook_oauth



19
20
21
# File 'app/controllers/facebook_oauth_controller.rb', line 19

def destroy
  self.current_facebook_access_token = nil
end

#newObject

GET /facebook_oauth/new



5
6
7
8
# File 'app/controllers/facebook_oauth_controller.rb', line 5

def new
  self.current_facebook_access_token = nil
  enforce_facebook_access_token root_path
end

#showObject

Redirect from Facebook: GET /facebook_oauth



11
12
13
14
15
16
# File 'app/controllers/facebook_oauth_controller.rb', line 11

def show
  self.current_facebook_access_token =
      facebook_client.authorization.process_callback params[:code],
          :redirect_uri => facebook_oauth_url
  redirect_to flash[:facebook_redirect_url] || root_url
end