Skip to content

Commit f8f3acb

Browse files
committed
fix(login): Support subfolder install for ephemeral sessions
Signed-off-by: Louis Chemineau <[email protected]>
1 parent 6b6ad44 commit f8f3acb

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,20 +10,23 @@
1010

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

1415
class FlowV2EphemeralSessionsCommand extends ALoginCommand {
1516
private ISession $session;
1617
private IURLGenerator $urlGenerator;
1718

1819
public function __construct(
1920
ISession $session,
21+
IURLGenerator $urlGenerator,
2022
) {
2123
$this->session = $session;
2224
$this->urlGenerator = $urlGenerator;
2325
}
2426

2527
public function process(LoginData $loginData): LoginResult {
26-
if (str_starts_with($loginData->getRedirectUrl() ?? '', '/login/v2/grant')) {
28+
$loginV2GrantRoute = $this->urlGenerator->linkToRoute('core.ClientFlowLoginV2.grantPage');
29+
if (str_starts_with($loginData->getRedirectUrl() ?? '', $loginV2GrantRoute)) {
2730
$this->session->set(ClientFlowLoginV2Controller::EPHEMERAL_NAME, true);
2831
}
2932

0 commit comments

Comments
 (0)