makes sure verifications only happen for signed in users when doing a letter verification

This commit is contained in:
kikito
2015-10-20 17:18:28 +02:00
parent 3ab579999e
commit 18db6482f9
2 changed files with 9 additions and 9 deletions

View File

@@ -52,7 +52,7 @@ class ApplicationController < ActionController::Base
end
def verify_lock
if current_user.try(:locked?)
if current_user.locked?
redirect_to account_path, alert: t('verification.alert.lock')
end
end
@@ -97,13 +97,13 @@ class ApplicationController < ActionController::Base
end
def verify_resident!
if current_user && !current_user.residence_verified?
unless current_user.residence_verified?
redirect_to new_residence_path, alert: t('verification.residence.alert.unconfirmed_residency')
end
end
def verify_verified!
if current_user.try(:level_three_verified?)
if current_user.level_three_verified?
redirect_to(account_path, notice: t('verification.redirect_notices.already_verified'))
end
end