Skip to content

Commit 57907e9

Browse files
committed
check if we already have a session token before attempting to retrieve a new one
1 parent 0688dfa commit 57907e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Services/FileMakerConnection.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Illuminate\Http\UploadedFile;
1515
use Illuminate\Support\Arr;
1616
use Illuminate\Support\Collection;
17-
use Illuminate\Support\Facades\Cache;
1817
use Illuminate\Support\Facades\Http;
1918
use Psr\Http\Message\RequestInterface;
2019
use Psr\Http\Message\ResponseInterface;
@@ -63,7 +62,12 @@ public function getLayout()
6362

6463
public function login()
6564
{
66-
// Store the session token
65+
// return early if we're already logged in
66+
if (self::$sessionToken) {
67+
return;
68+
}
69+
70+
// retrieve and store the session token
6771
self::$sessionToken = $this->fetchNewSessionToken();
6872
}
6973

0 commit comments

Comments
 (0)