Sha256: 53e133f6be8611819a60143bc9750bbcd782280dd2b6677b1a66100650e1690f

Contents?: true

Size: 714 Bytes

Versions: 6

Compression:

Stored size: 714 Bytes

Contents

# encoding: utf-8

module InvoiceBar
  class SessionsController < InvoiceBar::ApplicationController
    layout 'invoice_bar/layouts/signed_out'
  
    before_filter :require_login_from_http_basic, :only => [:login_from_http_basic]
    
    # Log in
    def new
    end
  
    def create
      user = login(params[:email], params[:password], params[:remember_me])
    
      if user
        redirect_back_or_to root_url
      else
        flash[:error] =  t('messages.cannot_log_in')
      
        render :new
      end
    end
  
    def destroy
      logout
    
      redirect_to root_url, notice: t('messages.logged_out')
    end
    
    def login_from_http_basic
      redirect_to root_path
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
invoice_bar-0.0.6 app/controllers/invoice_bar/sessions_controller.rb
invoice_bar-0.0.5 app/controllers/invoice_bar/sessions_controller.rb
invoice_bar-0.0.4 app/controllers/invoice_bar/sessions_controller.rb
invoice_bar-0.0.3 app/controllers/invoice_bar/sessions_controller.rb
invoice_bar-0.0.2 app/controllers/invoice_bar/sessions_controller.rb
invoice_bar-0.0.1 app/controllers/invoice_bar/sessions_controller.rb