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:
commit
9f63850279
3 changed files with 4 additions and 3 deletions
|
@ -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."
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue