Conversation
|
doobry-systemli
left a comment
There was a problem hiding this comment.
Overall looks promising 😊 Didn't test and grap the JWT authentication yet. Left some comments on things that caught my eye.
| $user = $this->security->getUser(); | ||
|
|
||
| $aliases = $this->aliasHandler->getEnabledAliasesByUser($user); | ||
| $data = []; |
There was a problem hiding this comment.
You could use array_map here (and similarily in the other controllers) and return it directly. Something along the lines of:
return $this->json(array_map(function (Alias $alias) {
return [
'id' => $alias->getId(),
'address' => $alias->getSource(),
'isRandom' => $alias->getRandom(),
];
}, $aliases), 200);|
|
||
| $data=[ | ||
| 'username' => $user->getEmail(), | ||
| 'mailcrypt_enabled' => $user->hasMailCrypt(), |
There was a problem hiding this comment.
Do we need to expose this via the API? What would be the usecase for a selfservice client? Recovery token would be more useful and important, no?
|
|
||
| namespace App\Traits; | ||
|
|
||
|
|
There was a problem hiding this comment.
These extra empty lines seem like leftovers?
082c759 to
b4c91fa
Compare
| #[Route('/api/user/aliases', name: 'get_user_aliases', methods: ['GET'])] | ||
| public function getAliases(): JsonResponse | ||
| { | ||
| $user = $this->security->getUser(); |
There was a problem hiding this comment.
Doesn't it work to use $this->getUser() directly from the parent AbstractController?
43512fb to
47c2bac
Compare
2985403 to
e71af4c
Compare


No description provided.