Sha256: 6031f586db4afa58779d8b08694bb498f64836d802d50b9280b0d408e1f919f1

Contents?: true

Size: 497 Bytes

Versions: 4

Compression:

Stored size: 497 Bytes

Contents

class SessionsController < ApplicationController
  before_filter :authenticate, :only => [:destroy]
  before_filter :current_user

  def create
    @user = User.find_by_provider_and_uid(auth_hash['provider'], auth_hash['uid']) || User.create_with_omniauth(auth_hash)
    session[:user_id] = @user.id
    redirect_to auth_path
  end

  def destroy
    session[:user_id] = nil
    redirect_to auth_path
  end

  def info

  end

  private
  def auth_hash
    request.env['omniauth.auth']
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dailycred-0.1.21 lib/generators/templates/sessions_controller.rb
dailycred-0.1.2 lib/generators/templates/sessions_controller.rb
dailycred-0.1.1 lib/generators/templates/sessions_controller.rb
dailycred-0.1.0 lib/generators/templates/sessions_controller.rb