Skip to content

Commit 1c1ff0f

Browse files
committed
fix(dav): better variable name for tokens
Signed-off-by: Enrique Pérez Arnaud <enrique@cazalla.net>
1 parent c652b1f commit 1c1ff0f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

lib/private/Files/Storage/DAV.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,21 +201,22 @@ protected function init(): void {
201201
}
202202
$this->ready = true;
203203

204+
// For Basic auth, the share token is kept as the user name
205+
$token = $this->user;
204206
// If using Bearer auth, use stored access token or exchange refresh token for access token
205-
$userName = $this->user;
206207
if ($this->authType !== null && ($this->authType & BearerAuthAwareSabreClient::AUTH_BEARER)) {
207208
// Check if we already have an access token stored (password field)
208209
if (!empty($this->password)) {
209-
$userName = $this->password;
210+
$token = $this->password;
210211
} else {
211-
$userName = $this->exchangeRefreshToken();
212+
$token = $this->exchangeRefreshToken();
212213
}
213-
$this->bearerToken = $userName;
214+
$this->bearerToken = $token;
214215
}
215216

216217
$settings = [
217218
'baseUri' => $this->createBaseUri(),
218-
'userName' => $userName,
219+
'userName' => $this->user,
219220
'password' => $this->password,
220221
];
221222
if ($this->authType !== null) {

0 commit comments

Comments
 (0)