Просмотр исходного кода

#4148 - Build-in API support (redirect after account deleted)

romanlesnikov 2 недель назад
Родитель
Сommit
301ada070f
1 измененных файлов с 7 добавлено и 3 удалено
  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)