refactors lock tries [#279]

This commit is contained in:
rgarcia
2015-09-10 17:51:18 +02:00
parent c1c213f773
commit abc68dc868
19 changed files with 171 additions and 63 deletions

View File

@@ -1,7 +1,7 @@
class Verification::SmsController < ApplicationController
before_action :authenticate_user!
before_action :verify_resident!
before_action :verify_attemps_left!, only: [:new, :create]
before_action :verify_lock, only: [:new, :create]
before_action :set_phone, only: :create
skip_authorization_check
@@ -68,10 +68,4 @@ class Verification::SmsController < ApplicationController
end
end
def verify_attemps_left!
if current_user.sms_confirmation_tries >= 3
redirect_to account_path, notice: t('verification.sms.alert.verify_attemps_left')
end
end
end