1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Merge pull request #3218 from timoschilling/fix_3201

use authentication_keys in flash message (fix #3201)
This commit is contained in:
José Valim 2014-09-24 08:15:40 +02:00
commit 9f63850279
3 changed files with 4 additions and 3 deletions

View file

@ -9,10 +9,10 @@ en:
failure:
already_authenticated: "You are already signed in."
inactive: "Your account is not activated yet."
invalid: "Invalid email or password."
invalid: "Invalid %{authentication_keys} or password."
locked: "Your account is locked."
last_attempt: "You have one more attempt before your account is locked."
not_found_in_database: "Invalid email or password."
not_found_in_database: "Invalid %{authentication_keys} or password."
timeout: "Your session expired. Please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your email address before continuing."

View file

@ -78,6 +78,7 @@ module Devise
options[:resource_name] = scope
options[:scope] = "devise.failure"
options[:default] = [message]
options[:authentication_keys] = Devise.authentication_keys.join(", ")
options = i18n_options(options)
I18n.t(:"#{scope}.#{message}", options)

View file

@ -580,7 +580,7 @@ class AuthenticationKeysTest < ActionDispatch::IntegrationTest
test 'missing authentication keys cause authentication to abort' do
swap Devise, authentication_keys: [:subdomain] do
sign_in_as_user
assert_contain "Invalid email or password."
assert_contain "Invalid subdomain or password."
assert_not warden.authenticated?(:user)
end
end