From 9638f782c974374a81fb543daaf13f1da6f19354 Mon Sep 17 00:00:00 2001 From: janis steiner Date: Thu, 7 May 2026 19:51:34 +0200 Subject: [PATCH] fix login --- backend/login.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/login.php b/backend/login.php index 8638476..0b37970 100644 --- a/backend/login.php +++ b/backend/login.php @@ -12,6 +12,10 @@ $success = ''; // Detect the correct callback URL $scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http'; $host = $_SERVER['HTTP_HOST'] ?? 'localhost:8080'; +// If no port in host and not standard port, add it +if (strpos($host, ':') === false && !in_array($_SERVER['SERVER_PORT'] ?? 80, [80, 443])) { + $host .= ':' . $_SERVER['SERVER_PORT']; +} $callbackUrl = "$scheme://$host/login.php"; if (isset($_GET['auth'])) {