Skip to content

Commit

Permalink
Merge pull request #2404 from LibreSign/bugfix/handle-pfx-password
Browse files Browse the repository at this point in the history
Bugfix handle pfx password
  • Loading branch information
vitormattos authored Feb 29, 2024
2 parents 9f81702 + abc898b commit 2d42fd1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/Controller/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ public function updateSettings(?string $phone = null): JSONResponse {
);
}

#[NoAdminRequired]
public function deletePfx(): JSONResponse {
$this->accountService->deletePfx($this->userSession->getUser());
return new JSONResponse(
Expand Down
4 changes: 3 additions & 1 deletion lib/Helper/ValidateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,9 @@ public function validateCredentials(SignRequest $signRequest, ?IUser $user, stri
}
}
if (empty($identifyMethods)) {
$identifyMethod = $this->identifyMethodService->getInstanceOfIdentifyMethod($identifyMethodName, $identifyValue);
$identifyMethod = $this->identifyMethodService
->setCurrentIdentifyMethod()
->getInstanceOfIdentifyMethod($identifyMethodName, $identifyValue);
} else {
$identifyMethod = current($identifyMethods);
}
Expand Down
9 changes: 7 additions & 2 deletions lib/Service/IdentifyMethodService.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,24 @@ private function isMandatoryMethod(string $methodName): bool {
public function getByUserData(array $data) {
$return = [];
foreach ($data as $method => $identifyValue) {
$this->currentIdentifyMethod = null;
$this->setCurrentIdentifyMethod();
$return[] = $this->getInstanceOfIdentifyMethod($method, $identifyValue);
}
return $return;
}

public function setCurrentIdentifyMethod(?IdentifyMethod $entity = null): self {
$this->currentIdentifyMethod = $entity;
return $this;
}

/**
* @return array<string,array<IIdentifyMethod>>
*/
public function getIdentifyMethodsFromSignRequestId(int $signRequestId): array {
$entities = $this->identifyMethodMapper->getIdentifyMethodsFromSignRequestId($signRequestId);
foreach ($entities as $entity) {
$this->currentIdentifyMethod = $entity;
$this->setCurrentIdentifyMethod($entity);
$this->getInstanceOfIdentifyMethod(
$entity->getIdentifierKey(),
$entity->getIdentifierValue(),
Expand Down

0 comments on commit 2d42fd1

Please sign in to comment.