Sha256: 78b9a724d839dfefe89de6c3f8039291925410ad1284e38f67589d80d990a702

Contents?: true

Size: 589 Bytes

Versions: 11

Compression:

Stored size: 589 Bytes

Contents

class SessionsController < ::Devise::SessionsController
  layout 'login'

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

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

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

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinerycms-authentication-0.9.9.12 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.11 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.10 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.9 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.8 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.7 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.5 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.4 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.3 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.2 app/controllers/sessions_controller.rb
refinerycms-authentication-0.9.9.1 app/controllers/sessions_controller.rb