Skip to content

Commit

Permalink
Remove hard-coded pin length in changePassword function
Browse files Browse the repository at this point in the history
  • Loading branch information
oharacj committed Dec 23, 2024
1 parent 072d3fb commit 11e26a4
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions module/VuFind/src/VuFind/ILS/Driver/SierraRest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1725,17 +1725,7 @@ public function changePassword($details)
'success' => false, 'status' => 'authentication_error_invalid',
];
}

if ($this->config['Authentication']['digits_only'] ?? false) {
$newPIN = preg_replace('/[^\d]/', '', trim($details['newPassword']));
if (strlen($newPIN) != 4) {
return [
'success' => false, 'status' => 'password_error_invalid',
];
}
} else {
$newPIN = trim($details['newPassword']);
}
$newPIN = trim($details['newPassword']);
$request = ['pin' => $newPIN];

$result = $this->makeRequest(
Expand Down

0 comments on commit 11e26a4

Please sign in to comment.