Sha256: 313cac23c56e902c2a0d393cb8d99cce349b07dbeb1c56df62a03d382c098d17

Contents?: true

Size: 586 Bytes

Versions: 34

Compression:

Stored size: 586 Bytes

Contents

require "rodauth"

# A plugin to enable case insensitive logins on Rodauth.
# It does that by downcasing any login inputs.
# Should not be enabled on existing installations unless logins are downcased in the database.
# See https://github.com/jeremyevans/rodauth/discussions/451
module Rodauth
  Feature.define(:case_insensitive_login, :CaseInsensitiveLogin) do
    def param(key)
      if [login_param, login_confirm_param].include?(key)
        super.downcase
      else
        super
      end
    end

    def account_from_login(login)
      super(login.downcase)
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
plutonium-0.19.8 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.7 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.6 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.5 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.4 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.3 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.2 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.1 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.19.0 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.8 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.7 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.6 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.5 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.4 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.3 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.2 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.1 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.18.0 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.16.5 lib/rodauth/features/case_insensitive_login.rb
plutonium-0.16.4 lib/rodauth/features/case_insensitive_login.rb