diff --git a/CHANGELOG.md b/CHANGELOG.md index bf371a63..8b985150 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Nedenfor ses dato for release og beskrivelse af opgaver som er implementeret. * Opdaterede installationsguide. * Applied Maestro notification patch () +* Brugte session type til at generere url'er. ## [2.7.5] 2024-01-29 diff --git a/web/modules/custom/os2forms_user_menu/src/Plugin/Block/UserMenuBlock.php b/web/modules/custom/os2forms_user_menu/src/Plugin/Block/UserMenuBlock.php index 654a8524..ac22a904 100644 --- a/web/modules/custom/os2forms_user_menu/src/Plugin/Block/UserMenuBlock.php +++ b/web/modules/custom/os2forms_user_menu/src/Plugin/Block/UserMenuBlock.php @@ -115,7 +115,6 @@ public function build() { if (empty($this->authProvider)) { return []; } - $plugin = $this->authProvider->getActivePlugin(); // Determine if we have an entity to work with. $pageEntity = $this->getPageEntity(); @@ -145,15 +144,19 @@ public function build() { return []; } + $sessionType = $webformNemIdSettings['session_type'] ?? NULL; + + $plugin = $sessionType ? $this->authProvider->getPluginInstance($webformNemIdSettings['session_type']) : $this->authProvider->getActivePlugin(); + $name = NULL; $loginUrl = NULL; $logoutUrl = NULL; if (!$plugin->isAuthenticated()) { - $loginUrl = $this->authProvider->getLoginUrl(); + $loginUrl = $this->authProvider->getLoginUrl([], $sessionType); } else { - $logoutUrl = $this->authProvider->getLogoutUrl(); + $logoutUrl = $this->authProvider->getLogoutUrl([], $sessionType); // Use cvr name if one exists. if ($cvr = $plugin->fetchValue('cvr')) { try {