From 0fd5e58588beef5aa18515c01cd718087c0f4557 Mon Sep 17 00:00:00 2001
From: steel <mael.acier@ensiie.fr>
Date: Sat, 18 Jan 2025 13:20:27 +0100
Subject: [PATCH] fix: update base URL generation in oidc.php to support Dokku
 proxy SSL configuration

---
 oidc.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/oidc.php b/oidc.php
index 5ed27e2..72012f7 100644
--- a/oidc.php
+++ b/oidc.php
@@ -15,7 +15,7 @@ $userinfoURL = "{$oauthURLBase}/userinfo";
 $apiURLBase =  getenv('API_SERVER') ?: 'https://api.iiens.net';
 
 // L'URL de ce script, utilisé comme URL de redirection
-$baseURL = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' && $_SERVER['SERVER_PORT'] != '443' ? ':' . $_SERVER['SERVER_PORT'] : '') . $_SERVER['PHP_SELF'];
+$baseURL = (getenv('DOKKU_PROXY_SSL_PORT') ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' && $_SERVER['SERVER_PORT'] != '443' ? ':' . $_SERVER['SERVER_PORT'] : '') . $_SERVER['PHP_SELF'];
 
 // On lance une session afin d'avoir un endroit où stocker les données entre les redirections
 session_start();
-- 
GitLab