Sha256: 338cde69df9a8e8bbeb0b70abb8c01fb9769293aead1c0c68ca6dfb7949c7168

Contents?: true

Size: 539 Bytes

Versions: 3

Compression:

Stored size: 539 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_unauth
  end

  def failure
    redirect_to_unauth notice: params[:message]
  end

  def info
  end

  private

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dailycred-0.1.36 app/controllers/sessions_controller.rb
dailycred-0.1.35 app/controllers/sessions_controller.rb
dailycred-0.1.34 app/controllers/sessions_controller.rb