Bläddra i källkod

Merge branch 'master' of https://github.com/unacms/UNA

AntonLV 2 veckor sedan
förälder
incheckning
c0e7b8e976
1 ändrade filer med 7 tillägg och 3 borttagningar
  1. 7 3
      template/scripts/BxBaseAccountForms.php

+ 7 - 3
template/scripts/BxBaseAccountForms.php

@@ -306,9 +306,13 @@ class BxBaseAccountForms extends BxDolProfileForms
         if ($iAccountId == getLoggedId())
             bx_logout();
 
-        // redirect to homepage
-        if(!$bIsApi)
-            $this->_redirectAndExit('', false);
+        // redirect to homepage (API: /logout clears client session, then goes home)
+        if($bIsApi)
+            return [
+                ['id' => 1, 'type' => 'redirect', 'data' => ['uri' => '/logout']],
+            ];
+
+        $this->_redirectAndExit('', false);
     }
 
     protected function _editAccountForm ($iAccountId, $sDisplayName)