SessionController: remove useless code

- the redirection of a locked user is made by the sign_in method
- because of the paranoid mode it displays the devise.failure.invalid error message
This commit is contained in:
simon lehericey 2019-08-16 15:32:00 +02:00
parent 08bb393ced
commit a3b9bf90d4

View file

@ -16,11 +16,7 @@ class Users::SessionsController < Devise::SessionsController
def create
remember_me = params[:user][:remember_me] == '1'
if resource_locked?(try_to_authenticate(User, remember_me))
flash.alert = 'Votre compte est verrouillé.'
new
return render :new, status: 401
end
try_to_authenticate(User, remember_me)
if user_signed_in?
current_user.update(loged_in_with_france_connect: nil)
@ -104,8 +100,4 @@ class Users::SessionsController < Devise::SessionsController
end
resource
end
def resource_locked?(resource)
resource.present? && resource.access_locked?
end
end