diff --git a/lib/AuthHelper.php b/lib/AuthHelper.php
index <HASH>..<HASH> 100644
--- a/lib/AuthHelper.php
+++ b/lib/AuthHelper.php
@@ -28,8 +28,11 @@ class AuthHelper
         else {
             $protocol = 'http';
         }
+        
+        $url = $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+        $url = false !== ($qsPos = strpos($url, '?')) ? substr($url, 0, $qsPos) : $url; // remove query params
 
-        return "$protocol://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+        return $url;
     }
 
     /**
Remove query params from current url