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'])) {