Skip to content

Commit

Permalink
fix(login): Support subfolder install for ephemeral sessions
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Mar 3, 2025
1 parent 90363d2 commit 2551cc7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@

use OC\Core\Controller\ClientFlowLoginV2Controller;
use OCP\ISession;
use OCP\IURLGenerator;

class FlowV2EphemeralSessionsCommand extends ALoginCommand {
private ISession $session;
private IURLGenerator $urlGenerator;

public function __construct(
ISession $session,
IURLGenerator $urlGenerator
) {
$this->session = $session;
$this->urlGenerator = $urlGenerator;
}

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

Expand Down

0 comments on commit 2551cc7

Please sign in to comment.