feat(microsoft-integration): enhance email permissions and consent flow for Outlook integration

This commit is contained in:
2026-09-10 14:42:19 +02:00
parent 8a930f572c
commit 291fb761c7
7 changed files with 95 additions and 28 deletions
+10 -1
View File
@@ -43,8 +43,17 @@ $state = generate_oauth_state((int)$user['id']);
$_SESSION['ms_oauth_state'] = $state;
$_SESSION['ms_oauth_user_id'] = (int)$user['id'];
// Onthoud eventuele gewenste terugkeerpagina (bijv. /mail.php)
if (!empty($_GET['return_to'])) {
$_SESSION['ms_oauth_return_to'] = trim($_GET['return_to']);
} else {
unset($_SESSION['ms_oauth_return_to']);
}
$forceConsent = !empty($_GET['reconsent']) || !empty($_GET['force']);
// Stuur gebruiker door naar Microsoft login
$authUrl = microsoft_get_auth_url($clientId, $redirectUri, $tenantId, $state);
$authUrl = microsoft_get_auth_url($clientId, $redirectUri, $tenantId, $state, $forceConsent);
header("Location: {$authUrl}");
exit;