Skip to content

Commit 18233e6

Browse files
committed
fixed lack of proper password validation
1 parent 51e57fe commit 18233e6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib/Mutation/AuthenticationMutation.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ public function createToken(Argument $args): array
3838

3939
try {
4040
$user = $this->userService->loadUserByLogin($args['username']);
41-
$this->userService->checkUserCredentials($user, $args['password']);
4241
} catch (NotFoundException) {
4342
return [
44-
'message' => 'Wrong username or password',
43+
'message' => 'Wrong username',
44+
'token' => null,
45+
];
46+
}
47+
48+
if (!$this->userService->checkUserCredentials($user, $args['password'])) {
49+
return [
50+
'message' => 'Wrong password',
4551
'token' => null,
4652
];
4753
}

0 commit comments

Comments
 (0)