aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 882b587a6fd..5f2131f388f 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -765,11 +765,20 @@ class OC {
return;
}
+ // Redirect to index if the logout link is accessed without valid session
+ // this is needed to prevent "Token expired" messages while login if a session is expired
+ // @see https://github.com/owncloud/core/pull/8443#issuecomment-42425583
+ if(isset($_GET['logout']) && !OC_User::isLoggedIn()) {
+ header("Location: " . OC::$WEBROOT.(empty(OC::$WEBROOT) ? '/' : ''));
+ return;
+ }
+
// Someone is logged in :
if (OC_User::isLoggedIn()) {
OC_App::loadApps();
OC_User::setupBackends();
if (isset($_GET["logout"]) and ($_GET["logout"])) {
+ OC_JSON::callCheck();
if (isset($_COOKIE['oc_token'])) {
OC_Preferences::deleteKey(OC_User::getUser(), 'login_token', $_COOKIE['oc_token']);
}
@@ -930,6 +939,7 @@ class OC {
return false;
}
+ OC_JSON::callCheck();
OC_App::loadApps();
//setup extra user backends