private function ServiceController::createRedirectResponse in CAS 8
Same name and namespace in other branches
- 2.x src/Controller/ServiceController.php \Drupal\cas\Controller\ServiceController::createRedirectResponse()
Create a redirect response that sends users somewhere after login.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request.
bool $login_failed: Indicates if the login failed or not.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse The redirect response.
1 call to ServiceController::createRedirectResponse()
- ServiceController::handle in src/
Controller/ ServiceController.php - Main point of communication between CAS server and the Drupal site.
File
- src/
Controller/ ServiceController.php, line 315
Class
- ServiceController
- Class ServiceController.
Namespace
Drupal\cas\ControllerCode
private function createRedirectResponse(Request $request, $login_failed = FALSE) {
// If login failed, we may have a failure page to send them to.
if ($login_failed && $this->settings
->get('error_handling.login_failure_page')) {
// Remove 'destination' parameter, otherwise Drupal's
// RedirectResponseSubscriber will send users to that location instead of
// the failure page.
$request->query
->remove('destination');
return RedirectResponse::create(Url::fromUserInput($this->settings
->get('error_handling.login_failure_page'))
->toString());
}
else {
$this->casHelper
->handleReturnToParameter($request);
return RedirectResponse::create($this->urlGenerator
->generate('<front>'));
}
}