authentication : manage correctely the routes (no trailling slash)

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3014 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-09-01 09:39:29 +00:00
parent 0ffebcda0b
commit 3873935e3a

View File

@@ -314,22 +314,30 @@ class authentication
public function routes () public function routes ()
{ {
$authObj = $this; $authObj = $this;
$this->route->get ("authentication/logout", function () use ($authObj) $route=$this->route;
$this->route
->get ("authentication/logout", function () use ($authObj)
{ {
$authObj->logout (); $authObj->logout ();
}); })
$this->route->get ("authentication(/{url})?", function ($url) use ($authObj) ->get ("authentication", function () use ($route)
{
$route->redirect ("/authentication/");
})
->get ("authentication/({url})?", function ($url) use ($authObj)
{ {
$authObj->pageHTML ($url); $authObj->pageHTML ($url);
exit; exit;
}); })
$this->route->post ("authentication(/{url})?", function ($url) use ($authObj) ->post ("authentication/({url})?", function ($url) use ($authObj)
{ {
$authObj->verifAuthLoginPage ($url); $authObj->verifAuthLoginPage ($url);
exit; exit;
}); })
;
$this->route->authenticationURL = "/authentication/"; $this->route->authenticationURL = "/authentication/";
} }