From 3873935e3a177439f4f228a8546ea622c6278a02 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 1 Sep 2016 09:39:29 +0000 Subject: [PATCH] authentication : manage correctely the routes (no trailling slash) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3014 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- authentication.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/authentication.php b/authentication.php index 0bfe467..5c9d301 100644 --- a/authentication.php +++ b/authentication.php @@ -314,22 +314,30 @@ class authentication public function routes () { $authObj = $this; - $this->route->get ("authentication/logout", function () use ($authObj) + $route=$this->route; + $this->route + ->get ("authentication/logout", function () use ($authObj) { $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); exit; - }); + }) - $this->route->post ("authentication(/{url})?", function ($url) use ($authObj) + ->post ("authentication/({url})?", function ($url) use ($authObj) { $authObj->verifAuthLoginPage ($url); exit; - }); + }) + ; $this->route->authenticationURL = "/authentication/"; }