putting the token in the warden session

This commit is contained in:
ilya 2010-09-24 10:45:27 -07:00
parent 755ccc084f
commit 82b99decbb
2 changed files with 4 additions and 4 deletions

View file

@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base
end end
def fb_user_info def fb_user_info
@access_token = session[:access_token] @access_token = env['warden'].session[:access_token]
@logged_in = @access_token.present? @logged_in = @access_token.present?
end end

View file

@ -17,15 +17,15 @@ class ServicesController < ApplicationController
# TODO: This is where you'd want to store the token in your database # TODO: This is where you'd want to store the token in your database
# but for now, we'll just keep it in the session so we don't need a database # but for now, we'll just keep it in the session so we don't need a database
session[:access_token] = @access_token env['warden'].session[:access_token] = @access_token
flash[:success] = "Authentication successful." flash[:success] = "Authentication successful."
end end
redirect_to edit_user_url current_user redirect_to edit_user_url current_user
end end
def destroy def destroy
session[:access_token] = nil env['warden'].session[:access_token] = nil
session[:user_id] = nil env['warden'].session[:user_id] = nil
redirect_to edit_user_url current_user redirect_to edit_user_url current_user
end end