app.rb
# Check whether the user's access token is valid.
Check whether the user's access token is valid.
Check whether the user ' s access token is valid .
def check_access_token
  @access_token = session[:access_token]
  begin
    @client = Octokit::Client.new :access_token => @access_token
    @user = @client.user
  rescue => e
    session[:access_token] = nil
    authenticate!
  end
end
def check_access_token @access_token = session [ :access_token ] begin @client = Octokit :: Client . new :access_token => @access_token @user = @client . user rescue => e session [ :access_token ] = nil authenticate! end end
Check whether the user's access token is valid.
Check whether the user ' s access token is valid .
# The token has been revoked, so invalidate the token in the session.