From f92d24a55dca875562b98c3d3697fc454798428b Mon Sep 17 00:00:00 2001
From: nod3zer0 <game1men@gmail.com>
Date: Fri, 30 Aug 2024 15:03:11 +0200
Subject: [PATCH] removed ReturnTo

removed ReturnTo to make plugin be able to login from all of the pages
in Stud.IP
---
 .../auth_plugins/StudipAuthSimpleSamlPHP.php    | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php b/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php
index 3d9f26cf3ad..69745a82024 100644
--- a/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php
+++ b/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php
@@ -60,7 +60,7 @@ class StudipAuthSimpleSamlPHP extends StudipAuthSSO
 
         // check if user is already authenticated and if not, authenticate them
         if (!$this->as->isAuthenticated()) {
-            $this->as->requireAuth(['ReturnTo' => $this->getReturnToURL()]);
+            $this->as->requireAuth();
         }
 
         $this->userdata = [];
@@ -98,19 +98,4 @@ class StudipAuthSimpleSamlPHP extends StudipAuthSSO
         $auth->Logout();
     }
 
-    /**
-     * Returns the required return to url
-     */
-    public function getReturnToURL(): string
-    {
-        $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
-        $return_to_url = URLHelper::getURL('dispatch.php/start', [
-            'again'        => 'yes',
-            'cancel_login' => 1,
-            'sso'          => $this->plugin_name,
-        ]);
-        URLHelper::setBaseURL($old_base);
-
-        return $return_to_url;
-    }
 }
-- 
GitLab