[Fix #1285] Create an endpoint to check password strength
This commit is contained in:
parent
35da5d595f
commit
2507f963b1
2 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
require 'zxcvbn'
|
||||
|
||||
class Administrateurs::ActivateController < ApplicationController
|
||||
layout "new_application"
|
||||
|
||||
|
@ -29,6 +31,11 @@ class Administrateurs::ActivateController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def test_password_strength
|
||||
score = Zxcvbn.test(params[:password], [], ZXCVBN_DICTIONNARIES).score
|
||||
render json: { score: score }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_administrateur_params
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue