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

Instance Method Details

#showObject



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

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