Commit 28af5625 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Correction du bug de redirection vers la page demandée en cas d'authentification CAS.

parent 9c7142fa
......@@ -2,6 +2,7 @@
namespace UnicaenAuth\Authentication;
use Zend\Http\PhpEnvironment\Request;
use Zend\Http\PhpEnvironment\Response;
use Zend\Mvc\Application;
use Zend\Mvc\Router\Exception;
......@@ -55,17 +56,21 @@ class RedirectCallback
*/
private function getRedirectRouteFromRequest()
{
/** @var Request $request */
$request = $this->application->getRequest();
$redirect = $request->getQuery('redirect');
if ($redirect && $this->routeExists($redirect)) {
return $redirect;
$redirectFromQuery = $request->getQuery('redirect');
if ($redirectFromQuery && $this->routeExists($redirectFromQuery)) {
return $redirectFromQuery;
}
$redirect = $request->getPost('redirect');
if ($redirect && $this->routeExists($redirect)) {
return $redirect;
$redirectFromPost = $request->getPost('redirect');
if ($redirectFromPost && $this->routeExists($redirectFromPost)) {
return $redirectFromPost;
}
$redirect = $redirectFromQuery ?: $redirectFromPost;
if ($redirect) {
return $redirect;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment