Conversation
| public function userInfo() { | ||
| $user = $this->userSession->getUser(); | ||
| if ($user === null) { | ||
| throw new \Exception(); |
There was a problem hiding this comment.
Could this Exception provide some details on why it was thrown?
| $avatarUrl = $this->urlGenerator->getAbsoluteURL($avatarUrl); | ||
| $data = [ | ||
| "sub" => $user->getUID(), | ||
| "picture" => $avatarUrl |
There was a problem hiding this comment.
"picture" could also be null if the avatar is unset; no? - I think it's better to return null than a URL that resolves into 404. Either that or link the generated avatar (the one with the letters)
So e.g. we can check for null for things like #95 instead of using a broken image link.
f4ee298 to
0672c05
Compare
Codecov Report
@@ Coverage Diff @@
## master #115 +/- ##
============================================
+ Coverage 81.51% 82.09% +0.58%
- Complexity 186 194 +8
============================================
Files 20 21 +1
Lines 660 687 +27
============================================
+ Hits 538 564 +26
- Misses 122 123 +1
Continue to review full report at Codecov.
|
| } | ||
|
|
||
| $avatarUrl = $this->urlGenerator->linkTo('', 'remote.php'); | ||
| $avatarUrl .= "/dav/avatars/{$user->getUID()}/96.jpeg"; |
There was a problem hiding this comment.
just a good common practice value
0672c05 to
c6fd355
Compare
c6fd355 to
c41fdd0
Compare
Implements the OpenID UserInfo Endpoint as per https://connect2id.com/products/server/docs/api/userinfo