Class: ThinkFeelDoEngine::PasswordEntropyBitsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/think_feel_do_engine/password_entropy_bits_controller.rb

Overview

Calculate the bits of entropy in a password.

Constant Summary

Constants inherited from ApplicationController

ApplicationController::CSRF_COOKIE_NAME, ApplicationController::CSRF_HEADER_NAME, ApplicationController::INACTIVE_MESSAGE, ApplicationController::ROOT_URI

Instance Method Summary collapse

Methods inherited from ApplicationController

#access_denied_resource_path, #after_sign_in_path_for, #after_sign_out_path_for, #raise_not_found!, #render_not_found

Instance Method Details

#showObject



7
8
9
10
11
12
13
14
# File 'app/controllers/think_feel_do_engine/password_entropy_bits_controller.rb', line 7

def show
  validator = PasswordValidator
              .new(
                password: params[:password],
                password_token: params[:reset_password_token]
              )
  render json: { bits: validator.entropy_value }
end