Skip to content

Commit 0e025e7

Browse files
authored
Merge pull request #160 from laravel/revert-143-patch-2
[2.x] Revert "[2.x] Add namespace check to Auth routes"
2 parents f539854 + a9f4085 commit 0e025e7

File tree

1 file changed

+28
-32
lines changed

1 file changed

+28
-32
lines changed

src/AuthRouteMethods.php

+28-32
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,38 @@ class AuthRouteMethods
1313
public function auth()
1414
{
1515
return function ($options = []) {
16-
$namespace = class_exists($this->prependGroupNamespace('Auth\LoginController')) ? null : 'App\Http\Controllers';
16+
// Login Routes...
17+
if ($options['login'] ?? true) {
18+
$this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
19+
$this->post('login', 'Auth\LoginController@login');
20+
}
21+
22+
// Logout Routes...
23+
if ($options['logout'] ?? true) {
24+
$this->post('logout', 'Auth\LoginController@logout')->name('logout');
25+
}
1726

18-
$this->group(['namespace' => $namespace], function() use($options) {
19-
// Login Routes...
20-
if ($options['login'] ?? true) {
21-
$this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
22-
$this->post('login', 'Auth\LoginController@login');
23-
}
27+
// Registration Routes...
28+
if ($options['register'] ?? true) {
29+
$this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
30+
$this->post('register', 'Auth\RegisterController@register');
31+
}
2432

25-
// Logout Routes...
26-
if ($options['logout'] ?? true) {
27-
$this->post('logout', 'Auth\LoginController@logout')->name('logout');
28-
}
33+
// Password Reset Routes...
34+
if ($options['reset'] ?? true) {
35+
$this->resetPassword();
36+
}
2937

30-
// Registration Routes...
31-
if ($options['register'] ?? true) {
32-
$this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
33-
$this->post('register', 'Auth\RegisterController@register');
34-
}
38+
// Password Confirmation Routes...
39+
if ($options['confirm'] ??
40+
class_exists($this->prependGroupNamespace('Auth\ConfirmPasswordController'))) {
41+
$this->confirmPassword();
42+
}
3543

36-
// Password Reset Routes...
37-
if ($options['reset'] ?? true) {
38-
$this->resetPassword();
39-
}
40-
41-
// Password Confirmation Routes...
42-
if ($options['confirm'] ??
43-
class_exists($this->prependGroupNamespace('Auth\ConfirmPasswordController'))) {
44-
$this->confirmPassword();
45-
}
46-
47-
// Email Verification Routes...
48-
if ($options['verify'] ?? false) {
49-
$this->emailVerification();
50-
}
51-
});
44+
// Email Verification Routes...
45+
if ($options['verify'] ?? false) {
46+
$this->emailVerification();
47+
}
5248
};
5349
}
5450

0 commit comments

Comments
 (0)