class SessionsController

Public Instance Methods

create() click to toggle source

The callback from logging in with facebook or twitter will hit this action. All logic for what you will do with the omniauth response hash goes here.

# File lib/generators/omniauth_initializer/templates/sessions_controller.rb, line 4
def create
  #@user = User.find_or_create_from_auth_hash(auth_hash)
  #self.current_user = @user
  #redirect_to '/'
end

Protected Instance Methods

auth_hash() click to toggle source

This auth_hash contains the response from the requested provider (facebook, twitter, etc)

# File lib/generators/omniauth_initializer/templates/sessions_controller.rb, line 13
def auth_hash
  request.env['omniauth.auth']
end