|
|
|
|
@ -84,7 +84,7 @@ class ClientFlowLoginV2Controller extends Controller {
|
|
|
|
|
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
|
|
|
|
|
#[UseSession]
|
|
|
|
|
#[FrontpageRoute(verb: 'GET', url: '/login/v2/flow/{token}')]
|
|
|
|
|
public function landing(string $token, $user = ''): Response {
|
|
|
|
|
public function landing(string $token, $user = '', int $direct = 0): Response {
|
|
|
|
|
if (!$this->loginFlowV2Service->startLoginFlow($token)) {
|
|
|
|
|
return $this->loginTokenForbiddenResponse();
|
|
|
|
|
}
|
|
|
|
|
@ -92,7 +92,7 @@ class ClientFlowLoginV2Controller extends Controller {
|
|
|
|
|
$this->session->set(self::TOKEN_NAME, $token);
|
|
|
|
|
|
|
|
|
|
return new RedirectResponse(
|
|
|
|
|
$this->urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.showAuthPickerPage', ['user' => $user])
|
|
|
|
|
$this->urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.showAuthPickerPage', ['user' => $user, 'direct' => $direct])
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -101,7 +101,7 @@ class ClientFlowLoginV2Controller extends Controller {
|
|
|
|
|
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
|
|
|
|
|
#[UseSession]
|
|
|
|
|
#[FrontpageRoute(verb: 'GET', url: '/login/v2/flow')]
|
|
|
|
|
public function showAuthPickerPage($user = ''): StandaloneTemplateResponse {
|
|
|
|
|
public function showAuthPickerPage(string $user = '', int $direct = 0): StandaloneTemplateResponse {
|
|
|
|
|
try {
|
|
|
|
|
$flow = $this->getFlowByLoginToken();
|
|
|
|
|
} catch (LoginFlowV2NotFoundException $e) {
|
|
|
|
|
@ -123,6 +123,7 @@ class ClientFlowLoginV2Controller extends Controller {
|
|
|
|
|
'urlGenerator' => $this->urlGenerator,
|
|
|
|
|
'stateToken' => $stateToken,
|
|
|
|
|
'user' => $user,
|
|
|
|
|
'direct' => $direct,
|
|
|
|
|
],
|
|
|
|
|
'guest'
|
|
|
|
|
);
|
|
|
|
|
@ -136,7 +137,7 @@ class ClientFlowLoginV2Controller extends Controller {
|
|
|
|
|
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
|
|
|
|
|
#[UseSession]
|
|
|
|
|
#[FrontpageRoute(verb: 'GET', url: '/login/v2/grant')]
|
|
|
|
|
public function grantPage(?string $stateToken): StandaloneTemplateResponse {
|
|
|
|
|
public function grantPage(?string $stateToken, int $direct = 0): StandaloneTemplateResponse {
|
|
|
|
|
if ($stateToken === null) {
|
|
|
|
|
return $this->stateTokenMissingResponse();
|
|
|
|
|
}
|
|
|
|
|
@ -163,6 +164,7 @@ class ClientFlowLoginV2Controller extends Controller {
|
|
|
|
|
'instanceName' => $this->defaults->getName(),
|
|
|
|
|
'urlGenerator' => $this->urlGenerator,
|
|
|
|
|
'stateToken' => $stateToken,
|
|
|
|
|
'direct' => $direct,
|
|
|
|
|
],
|
|
|
|
|
'guest'
|
|
|
|
|
);
|
|
|
|
|
|