Skip to content

Commit a43969d

Browse files
fix: authentication
1 parent 0ea211c commit a43969d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Services/Auth/LogInUser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ public function __construct(IncomingRequest $request, $username = 'username')
1515
throw new \Exception('User not found.');
1616
}
1717

18-
if (!password_verify($request->getPost('password'), $user->asObject()->first()->password)) {
18+
if (!password_verify($request->getPost('password'), $user->where($username, $request->getPost($username))->first()->password)) {
1919
throw new \Exception("Password is incorrect");
2020
}
2121

22-
$user = $user->asObject()->first();
22+
$user = $user->where($username, $request->getPost($username))->first();
2323
unset($user->password);
2424

2525
session()->set('user', $user);

0 commit comments

Comments
 (0)