diff --git a/login.php b/login.php
index 1b6973ce8537762d07a76c1d3db60013b6aa3a4d..4c7f3b6c12bd668c205d686803b5058d0847fca5 100644
--- a/login.php
+++ b/login.php
@@ -127,7 +127,8 @@ elseif ($user = UserAuthenticationBackend::processSignOn($errors, false)) {
         }
     }
     elseif ($user instanceof AuthenticatedUser) {
-        Http::redirect('tickets.php');
+        Http::redirect($_SESSION['_client']['auth']['dest']
+                ?: 'tickets.php');
     }
 }