app/controllers/application_controller.rb
def session_octokit
      token = session['oauth_token'] || ''
      if token == ''
        raise 'You must be signed in'
      end

      client = Strategies::GitStrategy.get_instance(token)
      if client.is_valid
        client
      else
        reset_session
        raise 'Looks like there was an issue authorizing you. Try signing in again!'
      end
    end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def session_octokit
      token = session['oauth_token'] || ''
      if token == ''
        raise 'You must be signed in'
      end
      client = Strategies::GitStrategy.get_instance(token)
      if client.is_valid
        client
      else
        reset_session
        raise 'Looks like there was an issue authorizing you. Try signing in again!'
      end
    end
def session_octokit token = session [ 'oauth_token' ] || '' if token == '' raise 'You must be signed in' end client = Strategies :: GitStrategy . get_instance ( token ) if client . is_valid client else reset_session raise 'Looks like there was an issue authorizing you. Try signing in again!' end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .