From a5445560258343e5f6208961d02d9e4750e7a9e3 Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Tue, 1 Oct 2024 10:35:53 +0200 Subject: [PATCH] BUGFIX since upgrade auth0 lib we are missing the login params --- app/Auth/AuthControllerProvider.php | 6 ++++-- src/Auth/AuthController.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Auth/AuthControllerProvider.php b/app/Auth/AuthControllerProvider.php index b6f439e9..74487132 100644 --- a/app/Auth/AuthControllerProvider.php +++ b/app/Auth/AuthControllerProvider.php @@ -15,13 +15,15 @@ public function connect(Application $app): ControllerCollection { $app['auth_controller'] = $app->share( function (Application $app) { + $authConfig = $app['config']['keycloak']['enable'] ? $app['config']['keycloak'] : $app['config']['auth0']; + return new AuthController( $app[Auth0::class], $app['session'], $app['uitid_user_session_service'], $app[UiTIDv1TokenService::class], - $app['config']['auth0']['login_parameters'], - $app['config']['auth0']['app_url'] + $authConfig['login_parameters'], + $authConfig['app_url'] ); } ); diff --git a/src/Auth/AuthController.php b/src/Auth/AuthController.php index ab97afc0..c2c6edd4 100644 --- a/src/Auth/AuthController.php +++ b/src/Auth/AuthController.php @@ -79,7 +79,7 @@ public function redirectToLoginService(Request $request): RedirectResponse $this->session->set('auth_destination', $destination); } - return new RedirectResponse($this->auth0->login(null, null, $this->loginParameters)); + return new RedirectResponse($this->auth0->login(null, $this->loginParameters)); } public function storeTokenAndRedirectToFrontend(): RedirectResponse