Skip to content

Commit

Permalink
Merge pull request #1227 from cultuurnet/PPF-450/minor-fixes
Browse files Browse the repository at this point in the history
PPF-450 Minor changes - Fix logout / fix open in keycloak link
  • Loading branch information
grubolsch authored Jun 27, 2024
2 parents f877e8e + 4856f11 commit 59f7d65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/Domain/Auth/Controllers/LogoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ private function getLogoutLink(): string
/** @var Auth0 $auth0 */
$auth0 = app(Auth0::class);

$idtoken = $auth0->getIdToken();

if (Auth::check()) {
$auth0->logout();
Auth::guard(config('nova.guard'))->logout();
Expand All @@ -32,7 +34,7 @@ private function getLogoutLink(): string
config(KeycloakConfig::KEYCLOAK_REALM_NAME),
config(KeycloakConfig::KEYCLOAK_CLIENT_ID),
$url,
$auth0->getIdToken()
$idtoken
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Nova/Resources/KeycloakClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function fields(NovaRequest $request): array
Text::make('Open', function (KeycloakClientModel $model) {
$client = $model->toDomain();
$realm = App::get(Realms::class)->getRealmByEnvironment($client->environment);
$url = $realm->baseUrl . 'admin/master/console/#/' . $realm->internalName . '/clients/' . $client->id->toString() . '/settings';
$url = $realm->baseUrl . 'dashboard/' . $realm->internalName . '/clients/' . urlencode($client->clientId) . '/settings';

return sprintf('<a href="%s" class="link-default" target="_blank">Open in Keycloak</a>', $url);
})->asHtml(),
Expand Down

0 comments on commit 59f7d65

Please sign in to comment.