Skip to content

Commit d29894b

Browse files
authored
Merge pull request #1134 from nextcloud/enh/noid/add-session-debug-logs
Add debug logs including the session ID
2 parents 8630a74 + 2082c25 commit d29894b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/Service/TokenService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(
6161
public function storeToken(array $tokenData): Token {
6262
$token = new Token($tokenData);
6363
$this->session->set(self::SESSION_TOKEN_KEY, json_encode($token, JSON_THROW_ON_ERROR));
64-
$this->logger->debug('[TokenService] Store token');
64+
$this->logger->debug('[TokenService] Store token in the session', ['session_id' => $this->session->getId()]);
6565
return $token;
6666
}
6767

@@ -75,6 +75,7 @@ public function storeToken(array $tokenData): Token {
7575
*/
7676
public function getToken(bool $refreshIfExpired = true): ?Token {
7777
$sessionData = $this->session->get(self::SESSION_TOKEN_KEY);
78+
$this->logger->debug('[TokenService] Get token from the session', ['session_id' => $this->session->getId()]);
7879
if (!$sessionData) {
7980
$this->logger->debug('[TokenService] getToken: no session data');
8081
return null;
@@ -226,6 +227,7 @@ public function getExchangedToken(string $targetAudience, array $extraScopes = [
226227
0,
227228
);
228229
}
230+
$this->logger->debug('[TokenService] Starting token exchange');
229231

230232
$loginToken = $this->getToken();
231233
if ($loginToken === null) {

0 commit comments

Comments
 (0)