Skip to content

Commit

Permalink
fixed lack of proper password validation
Browse files Browse the repository at this point in the history
  • Loading branch information
konradoboza committed Jun 26, 2024
1 parent 51e57fe commit 18233e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/Mutation/AuthenticationMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ public function createToken(Argument $args): array

try {
$user = $this->userService->loadUserByLogin($args['username']);
$this->userService->checkUserCredentials($user, $args['password']);
} catch (NotFoundException) {
return [
'message' => 'Wrong username or password',
'message' => 'Wrong username',
'token' => null,
];
}

if (!$this->userService->checkUserCredentials($user, $args['password'])) {
return [
'message' => 'Wrong password',
'token' => null,
];
}
Expand Down

0 comments on commit 18233e6

Please sign in to comment.