Sha256: 7a3e1b23fd66f5369edb6f92c77798ae5745d21a58f548a364498386ff3ab87d

Contents?: true

Size: 477 Bytes

Versions: 14

Compression:

Stored size: 477 Bytes

Contents

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

  # Callback Route for OAuth flow
  def create
    @user = User.find_or_create_with_omniauth auth_hash
    session[:user_id] = @user.id
    redirect_to "/auth"
  end

  #GET /logout
  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

14 entries across 8 versions & 1 rubygems

Version Path
dailycred-0.1.29 localtest/app/controllers/sessions_controller.rb
dailycred-0.1.28 localtest/app/controllers/sessions_controller.rb
dailycred-0.1.27 localtest/app/controllers/sessions_controller.rb
dailycred-0.1.27 lib/generators/templates/sessions_controller.rb
dailycred-0.1.26 lib/generators/templates/sessions_controller.rb
dailycred-0.1.26 localtest/app/controllers/sessions_controller.rb
dailycred-0.1.25 localtest/app/controllers/sessions_controller.rb
dailycred-0.1.25 lib/generators/templates/sessions_controller.rb
dailycred-0.1.24 localtest/app/controllers/sessions_controller.rb
dailycred-0.1.24 lib/generators/templates/sessions_controller.rb
dailycred-0.1.23 localtest/app/controllers/sessions_controller.rb
dailycred-0.1.23 lib/generators/templates/sessions_controller.rb
dailycred-0.1.22 lib/generators/templates/sessions_controller.rb
dailycred-0.1.22 localtest/app/controllers/sessions_controller.rb