Sha256: b87dac714c0452af58b52c5dbe02e3c9d79a3ad618e0617351b25b46fef4c4c9

Contents?: true

Size: 761 Bytes

Versions: 14

Compression:

Stored size: 761 Bytes

Contents

module Refinery
  class SessionsController < Devise::SessionsController
    helper Refinery::Core::Engine.helpers
    layout 'refinery/layouts/login'

    before_filter :clear_unauthenticated_flash, :only => [:new]

    def create
      super
    rescue ::BCrypt::Errors::InvalidSalt, ::BCrypt::Errors::InvalidHash
      flash[:error] = t('password_encryption', :scope => 'refinery.users.forgot')
      redirect_to refinery.new_refinery_user_password_path
    end

  protected

    # We don't like this alert.
    def clear_unauthenticated_flash
      if flash.keys.include?(:alert) and flash.any?{|k, v|
        ['unauthenticated', t('unauthenticated', :scope => 'devise.failure')].include?(v)
      }
        flash.delete(:alert)
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
refinerycms-authentication-2.1.5 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.1.4 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.1.3 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.1.2 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.1.1 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.1.0 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.10 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.9 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.8 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.7 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.6 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.5 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.4 app/controllers/refinery/sessions_controller.rb
refinerycms-authentication-2.0.3 app/controllers/refinery/sessions_controller.rb