mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
Only remove session cookies
This should disconnect without loosing long lived cookie
This commit is contained in:
parent
dd1152dd4f
commit
ebe1f986f1
3 changed files with 6 additions and 5 deletions
|
@ -215,7 +215,8 @@ void ShibbolethCredentials::persist(Account* account)
|
|||
void ShibbolethCredentials::invalidateToken(Account *account)
|
||||
{
|
||||
CookieJar *jar = static_cast<CookieJar*>(account->networkAccessManager()->cookieJar());
|
||||
jar->clearCookies();
|
||||
jar->deleteCookie(_shibCookie);
|
||||
jar->clearSessionCookies();
|
||||
removeShibCookie(account);
|
||||
_shibCookie = QNetworkCookie();
|
||||
// ### access to ctx missing, but might not be required at all
|
||||
|
|
|
@ -106,9 +106,9 @@ bool CookieJar::deleteCookie(const QNetworkCookie &delCookie)
|
|||
return removeSucceeded;
|
||||
}
|
||||
|
||||
void CookieJar::clearCookies()
|
||||
void CookieJar::clearSessionCookies()
|
||||
{
|
||||
setAllCookies(QList<QNetworkCookie>());
|
||||
setAllCookies(removeExpired(allCookies()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -139,7 +139,7 @@ QList<QNetworkCookie> CookieJar::removeExpired(const QList<QNetworkCookie> &cook
|
|||
{
|
||||
QList<QNetworkCookie> updatedList;
|
||||
foreach(const QNetworkCookie &cookie, cookies) {
|
||||
if (cookie.expirationDate() > QDateTime::currentDateTime()) {
|
||||
if (cookie.expirationDate() > QDateTime::currentDateTime() && !cookie.isSessionCookie()) {
|
||||
updatedList << cookie;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const;
|
||||
|
||||
virtual bool deleteCookie(const QNetworkCookie & cookie);
|
||||
void clearCookies();
|
||||
void clearSessionCookies();
|
||||
|
||||
signals:
|
||||
void newCookiesForUrl(const QList<QNetworkCookie>& cookieList, const QUrl& url);
|
||||
|
|
Loading…
Reference in a new issue