Skip to content

Commit

Permalink
#640: Used session type to generate urls
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Jan 31, 2024
1 parent ba01f8a commit 7b705ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Nedenfor ses dato for release og beskrivelse af opgaver som er implementeret.
* Opdaterede installationsguide.
* Applied Maestro notification patch
(<https://github.com/itk-dev/os2forms_selvbetjening/pull/270>)
* Brugte session type til at generere url'er.

## [2.7.5] 2024-01-29

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7b705ad

Please sign in to comment.