Skip to content

Commit

Permalink
Improve hidden fields list (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
aivis authored Mar 23, 2020
1 parent 04ab14f commit 5c56945
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The following extra information will be collected:
Additionally, you can specify which HTTP request field values should not be sent to Understand.io.
By default, the following field values will be hidden:
```
UNDERSTAND_HIDDEN_REQUEST_FIELDS=password,access_token,secret_key,token,access_key
UNDERSTAND_HIDDEN_REQUEST_FIELDS=password,password_confirmation,access_token,secret_key,token,access_key
```

If you wish you can publish the configuration file and make desired adjustments. See [Advanced configuration](#advanced-configuration)
Expand Down
2 changes: 1 addition & 1 deletion src/config/understand-laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@
* Field names which values should not be sent to Understand.io
* It applies to POST and GET request parameters
*/
'hidden_fields' => explode(',', env('UNDERSTAND_HIDDEN_REQUEST_FIELDS', 'password,access_token,secret_key,token,access_key')),
'hidden_fields' => explode(',', env('UNDERSTAND_HIDDEN_REQUEST_FIELDS', 'password,password_confirmation,access_token,secret_key,token,access_key')),
];
11 changes: 11 additions & 0 deletions tests/FieldProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ public function testPostRequestParameters()
$this->assertEquals('[value hidden]', $postData['password']);
}

public function testPasswordConfirmationField()
{
\Illuminate\Support\Facades\Route::post('/', function() {});

$this->call('POST', '/', ['password_confirmation' => 'a']);

$postData = $this->app['understand.fieldProvider']->getPostDataArray();

$this->assertEquals('[value hidden]', $postData['password_confirmation']);
}

public function testJsonRequest()
{
if ( ! method_exists($this, 'json'))
Expand Down

0 comments on commit 5c56945

Please sign in to comment.