From 6c9ad6a559f42645974dbe25a689a41a90a4951c Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Mon, 10 Feb 2025 09:37:57 +0100
Subject: [PATCH] re #5

---
 CookieAuth.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CookieAuth.php b/CookieAuth.php
index fedc88f..aa1f875 100644
--- a/CookieAuth.php
+++ b/CookieAuth.php
@@ -98,6 +98,7 @@ final class CookieAuth extends StudIPPlugin implements SystemPlugin
     public function login_action(): void
     {
         $redirect = Request::get('return_to', 'index.php');
+        $location = URLHelper::getURL($redirect);
 
         if (
             $this->cookie_login_user
@@ -109,7 +110,8 @@ final class CookieAuth extends StudIPPlugin implements SystemPlugin
             auth()->setAuthenticatedUser($this->cookie_login_user);
         }
 
-        header('Location: ' . URLHelper::getURL($redirect));
+        header('Location: ' . $location, true, 302);
+        die;
     }
 
     public static function onEnable($plugin_id)
-- 
GitLab