Skip to content

Commit 0177d60

Browse files
committed
fix(login): Support subfolder install for ephemeral sessions
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent d2b504a commit 0177d60

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/private/Authentication/Login/FlowV2EphemeralSessionsCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010

1111
use OC\Core\Controller\ClientFlowLoginV2Controller;
1212
use OCP\ISession;
13+
use OCP\IURLGenerator;
1314

1415
class FlowV2EphemeralSessionsCommand extends ALoginCommand {
1516
public function __construct(
1617
private ISession $session,
18+
private IURLGenerator $urlGenerator,
1719
) {
1820
}
1921

2022
public function process(LoginData $loginData): LoginResult {
21-
if (str_starts_with($loginData->getRedirectUrl() ?? '', '/login/v2/grant')) {
23+
$loginV2GrantRoute = $this->urlGenerator->linkToRoute('core.ClientFlowLoginV2.grantPage');
24+
if (str_starts_with($loginData->getRedirectUrl() ?? '', $loginV2GrantRoute)) {
2225
$this->session->set(ClientFlowLoginV2Controller::EPHEMERAL_NAME, true);
2326
}
2427

0 commit comments

Comments
 (0)