Skip to content

Commit a0c22ff

Browse files
chore: Fix issues created on rebase
1 parent d4f4b25 commit a0c22ff

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

app/libs/Auth/AuthService.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ final class AuthService extends AbstractService implements IAuthService
9999
* @param IAuthUserService $auth_user_service
100100
* @param ISecurityContextService $security_context_service
101101
* @param ITransactionService $tx_service
102-
* @params ISecurityContextService $security_context_service
103102
*/
104103
public function __construct
105104
(
@@ -137,10 +136,7 @@ public function isUserLogged()
137136
*/
138137
public function getCurrentUser(): ?User
139138
{
140-
$user = Auth::user();
141-
if ($user instanceof User) {
142-
return $user;
143-
}
139+
return Auth::user();
144140
}
145141

146142
/**
@@ -435,13 +431,13 @@ public function validateCredentials(string $username, string $password): User
435431
* @var User|null $user
436432
*/
437433
$user = Auth::getProvider()->retrieveByCredentials(['username' => $username, 'password' => $password]);
438-
if (!$user instanceof User || !$user->canLogin()) {
439-
throw new AuthenticationException("We are sorry, your username or password does not match an existing record.");
440-
}
441434
} catch (UnverifiedEmailMemberException $ex) {
442435
throw new AuthenticationException($ex->getMessage());
443436
}
444437

438+
if (is_null($user) || !$user instanceof User || !$user->canLogin()) {
439+
throw new AuthenticationException("We are sorry, your username or password does not match an existing record.");
440+
}
445441
return $user;
446442
}
447443

0 commit comments

Comments
 (0)