Skip to content

Commit f33c1e7

Browse files
Log the session request as well
1 parent c25e0f6 commit f33c1e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Services/FileMakerConnection.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ public function login()
103103
*/
104104
protected function fetchNewSessionToken()
105105
{
106+
$start = microtime(true);
107+
106108
$url = $this->getDatabaseUrl() . '/sessions';
107109

108110
// prepare the post body
109111
$postBody = [
110-
'fmDataSource' => [Arr::only($this->config, ['database', 'username', 'password']),
112+
'fmDataSource' => [
113+
Arr::only($this->config, ['database', 'username', 'password']),
111114
],
112115
];
113116

@@ -118,6 +121,11 @@ protected function fetchNewSessionToken()
118121
// Check for errors
119122
$this->checkResponseForErrors($response);
120123

124+
Arr::set($postBody, 'fmDataSource.0.username', str_repeat('*', strlen(Arr::get($postBody, 'fmDataSource.0.username'))));
125+
Arr::set($postBody, 'fmDataSource.0.password', str_repeat('*', strlen(Arr::get($postBody, 'fmDataSource.0.password'))));
126+
127+
$this->logFMQuery('post', $url, $postBody, $start);
128+
121129
// Get the session token from the response
122130
$token = Arr::get($response, 'response.token');
123131

0 commit comments

Comments
 (0)