Browse Source

add messaging for not activated users

CLDC-2594-deactivated-user-login-custom-error
Samuel 4 weeks ago
parent
commit
dfe2413851
  1. 9
      app/models/user.rb
  2. 1
      config/locales/devise.en.yml

9
app/models/user.rb

@ -269,7 +269,14 @@ class User < ApplicationRecord
end
def valid_for_authentication?
super && active?
super && account_is_active?
end
def account_is_active?
unless active?
throw(:warden, message: :inactive_account)
end
true
end
def editable_duplicate_lettings_logs_sets

1
config/locales/devise.en.yml

@ -16,6 +16,7 @@ en:
timeout: "Your session expired. Sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You must confirm your email address before continuing."
inactive_account: "Your account has been deactivated. Ask a data coordinator at your organisation to reactivate your account. Contact the helpdesk if you don't know who your data coordinator is."
mailer:
confirmation_instructions:
subject: "Confirmation instructions."

Loading…
Cancel
Save