From 9315de8a4c7c120fe5f7f0771d55144b848580d0 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 10 Jun 2015 14:03:31 +0100 Subject: [PATCH] Fixed up the middleware --- app/Http/Kernel.php | 2 +- app/Http/Middleware/Admin.php | 10 +++--- app/Http/Middleware/ApiAuthenticate.php | 6 ++-- app/Http/Middleware/Authenticate.php | 6 ++-- .../Middleware/RedirectIfAuthenticated.php | 10 +++--- app/Http/Middleware/VerifyCsrfToken.php | 31 ------------------- 6 files changed, 21 insertions(+), 44 deletions(-) delete mode 100644 app/Http/Middleware/VerifyCsrfToken.php diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 2f8e8c14..1582c299 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -39,7 +39,7 @@ class Kernel extends HttpKernel 'auth.api' => 'CachetHQ\Cachet\Http\Middleware\ApiAuthenticate', 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', 'guest' => 'CachetHQ\Cachet\Http\Middleware\RedirectIfAuthenticated', - 'csrf' => 'CachetHQ\Cachet\Http\Middleware\VerifyCsrfToken', + 'csrf' => 'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken', 'admin' => 'CachetHQ\Cachet\Http\Middleware\Admin', 'login.throttling' => 'CachetHQ\Cachet\Http\Middleware\LoginThrottling', 'app.isSetup' => 'CachetHQ\Cachet\Http\Middleware\AppIsSetup', diff --git a/app/Http/Middleware/Admin.php b/app/Http/Middleware/Admin.php index 37126628..801d15ce 100644 --- a/app/Http/Middleware/Admin.php +++ b/app/Http/Middleware/Admin.php @@ -18,16 +18,18 @@ use Illuminate\Support\Facades\Response; class Admin { /** - * The Guard implementation. + * The authentication guard instance. * - * @var Guard + * @var \Illuminate\Contracts\Auth\Guard */ protected $auth; /** - * Create a new filter instance. + * Create a new admin middleware instance. * - * @param Guard $auth + * @param \Illuminate\Contracts\Auth\Guard $auth + * + * @return void */ public function __construct(Guard $auth) { diff --git a/app/Http/Middleware/ApiAuthenticate.php b/app/Http/Middleware/ApiAuthenticate.php index 0b262276..456398d0 100644 --- a/app/Http/Middleware/ApiAuthenticate.php +++ b/app/Http/Middleware/ApiAuthenticate.php @@ -19,16 +19,18 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; class ApiAuthenticate { /** - * The Guard implementation. + * The authentication guard instance. * * @var \Illuminate\Contracts\Auth\Guard */ protected $auth; /** - * Create a new filter instance. + * Create a new api authenticate middleware instance. * * @param \Illuminate\Contracts\Auth\Guard $auth + * + * @return void */ public function __construct(Guard $auth) { diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 75413e0b..7adbc125 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -17,16 +17,18 @@ use Illuminate\Contracts\Auth\Guard; class Authenticate { /** - * The Guard implementation. + * The authentication guard instance. * * @var \Illuminate\Contracts\Auth\Guard */ protected $auth; /** - * Create a new filter instance. + * Create a new authenticate middleware instance. * * @param \Illuminate\Contracts\Auth\Guard $auth + * + * @return void */ public function __construct(Guard $auth) { diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 52fc9752..e6a19744 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -18,16 +18,18 @@ use Illuminate\Http\RedirectResponse; class RedirectIfAuthenticated { /** - * The Guard implementation. + * The authentication guard instance. * - * @var Guard + * @var \Illuminate\Contracts\Auth\Guard */ protected $auth; /** - * Create a new filter instance. + * Create a new redirect if authenticated middleware instance. * - * @param Guard $auth + * @param \Illuminate\Contracts\Auth\Guard $auth + * + * @return void */ public function __construct(Guard $auth) { diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php deleted file mode 100644 index 7199ef14..00000000 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace CachetHQ\Cachet\Http\Middleware; - -use Closure; -use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier; - -class VerifyCsrfToken extends BaseVerifier -{ - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * - * @return mixed - */ - public function handle($request, Closure $next) - { - return parent::handle($request, $next); - } -}