Clean up code

This commit is contained in:
brantje 2016-09-30 20:49:35 +02:00
parent 9dd4a86ec4
commit c94870e1c3
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F

View file

@ -46,17 +46,15 @@ class VaultController extends ApiController {
foreach($vaults as $vault){
$credential = $this->credentialService->getRandomCredentialByVaultId($vault->getId(), $this->userId);
$secret_field = $protected_credential_fields[array_rand($protected_credential_fields)];
$challenge_password = $credential->{$secret_field}();
$vault = array(
array_push($result, array(
'vault_id' => $vault->getId(),
'guid' => $vault->getGuid(),
'name' => $vault->getName(),
'created' => $vault->getCreated(),
'public_sharing_key' => $vault->getPublicSharingKey(),
'last_access' => $vault->getlastAccess(),
'challenge_password' => $challenge_password
);
array_push($result, $vault);
'challenge_password' => $credential->{$secret_field}()
));
}
return new JSONResponse($result);