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 <[email protected]>
  • Loading branch information
artonge committed Feb 27, 2025
1 parent 47bd75a commit 68f86b3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@

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

class FlowV2EphemeralSessionsCommand extends ALoginCommand {
public function __construct(
private ISession $session,
private IURLGenerator $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 68f86b3

Please sign in to comment.