2019-08-08 11:06:28 +02:00
|
|
|
class Administrateurs::PasswordsController < ApplicationController
|
2019-06-20 00:36:50 +02:00
|
|
|
def test_strength
|
|
|
|
@score, @words, @length = ZxcvbnService.new(password_params[:password]).complexity
|
|
|
|
@min_length = PASSWORD_MIN_LENGTH
|
|
|
|
@min_complexity = PASSWORD_COMPLEXITY_FOR_ADMIN
|
|
|
|
render 'shared/password/test_strength'
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def password_params
|
2019-08-08 11:06:28 +02:00
|
|
|
params.require(:administrateur).permit(:password)
|
2019-06-20 00:36:50 +02:00
|
|
|
end
|
|
|
|
end
|