Skip to content

Commit

Permalink
Merge 6fb55da into 3f85584
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Feb 21, 2020
2 parents 3f85584 + 6fb55da commit 3e347b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Controller/GraphQL/MeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ public function me(): ?UserInterface
$user = $token->getUser();

if (!$user instanceof UserInterface) {
// getUser() can be an object with a toString or a string
$userName = (string) $user;
$user = new BasicUser($userName);
// getUser() can be the "anon." string.
return null;
}

return $user;
Expand Down
5 changes: 1 addition & 4 deletions Tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,7 @@ public function testMeQuery(): void

$this->assertSame([
'data' => [
'me' => [
'userName' => 'anon.',
'roles' => [],
]
'me' => null
]
], $result);

Expand Down

0 comments on commit 3e347b8

Please sign in to comment.