From a9f4085274552ce51751189cecf7cbee07b231f4 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Fri, 18 Sep 2020 14:31:11 +0200 Subject: [PATCH] Revert "[2.x] Add namespace check to Auth routes" --- src/AuthRouteMethods.php | 60 +++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/src/AuthRouteMethods.php b/src/AuthRouteMethods.php index 0b58f13..3faa6b5 100644 --- a/src/AuthRouteMethods.php +++ b/src/AuthRouteMethods.php @@ -13,42 +13,38 @@ class AuthRouteMethods public function auth() { return function ($options = []) { - $namespace = class_exists($this->prependGroupNamespace('Auth\LoginController')) ? null : 'App\Http\Controllers'; + // Login Routes... + if ($options['login'] ?? true) { + $this->get('login', 'Auth\LoginController@showLoginForm')->name('login'); + $this->post('login', 'Auth\LoginController@login'); + } + + // Logout Routes... + if ($options['logout'] ?? true) { + $this->post('logout', 'Auth\LoginController@logout')->name('logout'); + } - $this->group(['namespace' => $namespace], function() use($options) { - // Login Routes... - if ($options['login'] ?? true) { - $this->get('login', 'Auth\LoginController@showLoginForm')->name('login'); - $this->post('login', 'Auth\LoginController@login'); - } + // Registration Routes... + if ($options['register'] ?? true) { + $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); + $this->post('register', 'Auth\RegisterController@register'); + } - // Logout Routes... - if ($options['logout'] ?? true) { - $this->post('logout', 'Auth\LoginController@logout')->name('logout'); - } + // Password Reset Routes... + if ($options['reset'] ?? true) { + $this->resetPassword(); + } - // Registration Routes... - if ($options['register'] ?? true) { - $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); - $this->post('register', 'Auth\RegisterController@register'); - } + // Password Confirmation Routes... + if ($options['confirm'] ?? + class_exists($this->prependGroupNamespace('Auth\ConfirmPasswordController'))) { + $this->confirmPassword(); + } - // Password Reset Routes... - if ($options['reset'] ?? true) { - $this->resetPassword(); - } - - // Password Confirmation Routes... - if ($options['confirm'] ?? - class_exists($this->prependGroupNamespace('Auth\ConfirmPasswordController'))) { - $this->confirmPassword(); - } - - // Email Verification Routes... - if ($options['verify'] ?? false) { - $this->emailVerification(); - } - }); + // Email Verification Routes... + if ($options['verify'] ?? false) { + $this->emailVerification(); + } }; }