Skip to content

Commit

Permalink
sensative account information was not being encrypted via patch
Browse files Browse the repository at this point in the history
  • Loading branch information
MelonSmasher committed Nov 15, 2017
1 parent 585583b commit 5cc488b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/API/V1/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ public function patch(Request $request)
unset($data['page']);
}

// Encrypt any sensitive information
if (array_key_exists('ssn', $data)) $data['ssn'] = encrypt($data['ssn']);
if (array_key_exists('password', $data)) $data['password'] = encrypt($data['password']);
if (array_key_exists('birth_date', $data)) $data['birth_date'] = encrypt($data['birth_date']);

// Get the account
$item = Account::where(['identifier' => $data['identifier']]);
// Create a new transformer
Expand Down

0 comments on commit 5cc488b

Please sign in to comment.