Skip to content

Commit 1d74b20

Browse files
committed
review logincontroller
1 parent 0e2a6a5 commit 1d74b20

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/Http/Controllers/Auth/LoginController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ class LoginController extends Controller
3232
public function __construct()
3333
{
3434
$this->middleware('guest')->except('logout');
35-
$this->username = $this->findUsername();
35+
$this->username = $this->findLoginType();
3636
}
3737

3838
/**
3939
* Determine the field used for login (email or login).
4040
*/
41-
public function findUsername()
41+
public function findLoginType()
4242
{
4343
$login = request()->input('login');
4444

@@ -152,7 +152,6 @@ protected function attemptLogin(Request $request)
152152
'email' => $ldapUser->getFirstAttribute('mail') ?? 'user@localhost.local',
153153
'login' => $identifier,
154154
'role' => 5, // Auditee
155-
// Store a random password so DB auth is not accidentally usable unless you set one explicitly
156155
'password' => bcrypt(str()->random(32)),
157156
]);
158157
}

0 commit comments

Comments
 (0)