Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/PasswordPolicyController.php
Show All 19 Lines | class PasswordPolicyController extends Controller | ||||
{ | { | ||||
// Get the account owner | // Get the account owner | ||||
$owner = $this->guard()->user()->walletOwner(); | $owner = $this->guard()->user()->walletOwner(); | ||||
// Get the policy | // Get the policy | ||||
$policy = new Password($owner); | $policy = new Password($owner); | ||||
$rules = $policy->rules(true); | $rules = $policy->rules(true); | ||||
// Get the account's password retention config | |||||
$config = [ | |||||
'max_password_age' => $owner->getSetting('max_password_age'), | |||||
]; | |||||
return response()->json([ | return response()->json([ | ||||
'list' => array_values($rules), | 'list' => array_values($rules), | ||||
'count' => count($rules), | 'count' => count($rules), | ||||
'config' => $config, | |||||
]); | ]); | ||||
} | } | ||||
/** | /** | ||||
* Validate the password regarding the defined policies. | * Validate the password regarding the defined policies. | ||||
* | * | ||||
* @param \Illuminate\Http\Request $request | * @param \Illuminate\Http\Request $request | ||||
* | * | ||||
Show All 28 Lines |