@ctrl/qbittorrent 7.1.1 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/qbittorrent.js +9 -3
- package/package.json +1 -1
package/dist/src/qbittorrent.js
CHANGED
@@ -541,9 +541,15 @@ export class QBittorrent {
|
|
541
541
|
}
|
542
542
|
this._sid = cookie.SID;
|
543
543
|
// Not sure if it might be lowercase
|
544
|
-
const expires = cookie.Expires ?? cookie.expires
|
545
|
-
//
|
546
|
-
|
544
|
+
const expires = cookie.Expires ?? cookie.expires;
|
545
|
+
// Assumed to be in seconds
|
546
|
+
const maxAge = cookie['Max-Age'] ?? cookie['max-age'];
|
547
|
+
this._exp = expires
|
548
|
+
? new Date(expires)
|
549
|
+
: maxAge
|
550
|
+
? new Date(Number(maxAge) * 1000)
|
551
|
+
: // Default expiration 1 hour
|
552
|
+
new Date(Date.now() + 3600000);
|
547
553
|
return true;
|
548
554
|
}
|
549
555
|
logout() {
|