Sha256: 60b8d97fae8e221588a9ed3a01b21ff44d14f7c353f2511f814b1c8b26e4bbe3

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

module Multiauth
  class SessionsController < ApplicationController
    def new
    end

    def auth
      # see http://github.com/intridea/omniauth/wiki/Auth-Hash-Schema
      if logged_in?
        self.current_user.connect(params['auth'] || request.env['rack.auth'])
      else
        self.current_user = User.authenticate(params['auth'] || request.env['rack.auth'])
      end

      if logged_in?
        redirect_to root_path
      else
        render 'new'
      end
    end

    def failure
      flash.now[:error] = params[:message]
      render 'new'
    end

    def destroy
      self.current_user = nil
      redirect_to root_path
    end

    protected
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
multiauth-0.2.5 app/controllers/multiauth/sessions_controller.rb
multiauth-0.2.3 app/controllers/multiauth/sessions_controller.rb
multiauth-0.2.2 app/controllers/multiauth/sessions_controller.rb
multiauth-0.2.1 app/controllers/multiauth/sessions_controller.rb