diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 097a770831..753631ddf6 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -337,7 +337,7 @@ class LoginController extends Controller { $user, $originalUser, $redirect_url, string $loginMessage) { // Read current user and append if possible we need to // return the unmodified user otherwise we will leak the login name - $args = $user !== null ? ['user' => $originalUser] : []; + $args = $user !== null ? ['user' => $originalUser, 'direct' => 1] : []; if ($redirect_url !== null) { $args['redirect_url'] = $redirect_url; } diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index e9d4a89aa7..69752bf6d3 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -440,6 +440,7 @@ class LoginControllerTest extends TestCase { ->with('core.login.showLoginForm', [ 'user' => $user, 'redirect_url' => '/apps/files', + 'direct' => 1 ]) ->willReturn($loginPageUrl); $expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl); @@ -597,6 +598,7 @@ class LoginControllerTest extends TestCase { ->with('core.login.showLoginForm', [ 'user' => 'john@doe.com', 'redirect_url' => '/apps/files', + 'direct' => 1 ]) ->willReturn($loginPageUrl); $expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl);