summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-02-10 15:19:19 +0100
committerGitHub <noreply@github.com>2021-02-10 15:19:19 +0100
commita05e0c45b89e8793d73e0cec92080e8bd86472b4 (patch)
treeaf95190a0b71f4c6987e8bb3e829b557e074aa4b
parent2018bcba9bd268cbd9dd38feafe54c6f26dc7849 (diff)
parent97859866d7c2e72450b81311604bce28eb4eca8f (diff)
downloadnextcloud-server-a05e0c45b89e8793d73e0cec92080e8bd86472b4.tar.gz
nextcloud-server-a05e0c45b89e8793d73e0cec92080e8bd86472b4.zip
Merge pull request #25431 from nextcloud/backport/25424/stable19
[stable19] Keep direct login active when redirecting
-rw-r--r--core/Controller/LoginController.php2
-rw-r--r--tests/Core/Controller/LoginControllerTest.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index 097a7708318..753631ddf6f 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 e9d4a89aa7d..69752bf6d3c 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);