Sha256: 9917a21dc288a2e45979d0572930495abfee8518c67c1076669139f6037db4b4

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

class Spree::UserSessionsController < Devise::SessionsController
  include Spree::Core::ControllerHelpers
  helper 'spree/users', 'spree/base'

  include Spree::Core::CurrentOrder

  after_filter :associate_user, :only => :create

  ssl_required :new, :create, :destroy, :update
  ssl_allowed :login_bar

  # GET /resource/sign_in
  def new
    super
  end

  def create
    authenticate_user!

    if user_signed_in?
      respond_to do |format|
        format.html {
          flash.notice = t(:logged_in_succesfully)
          redirect_back_or_default(products_path)
        }
        format.js {
          user = resource.record
          render :json => {:ship_address => user.ship_address, :bill_address => user.bill_address}.to_json
        }
      end
    else
      flash.now[:error] = t('devise.failure.invalid')
      render :new
    end
  end

  def destroy
    session.clear
    super
  end

  def nav_bar
    render :partial => 'spree/shared/nav_bar'
  end

  private
    def accurate_title
      t(:login)
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_auth-1.0.1 app/controllers/spree/user_sessions_controller.rb
spree_auth-1.0.0 app/controllers/spree/user_sessions_controller.rb
spree_auth-1.0.0.rc4 app/controllers/spree/user_sessions_controller.rb
spree_auth-1.0.0.rc3 app/controllers/spree/user_sessions_controller.rb
spree_auth-1.0.0.rc2 app/controllers/spree/user_sessions_controller.rb