diff options
author | David Guillot <david@guillot.me> | 2018-06-29 22:28:12 +0200 |
---|---|---|
committer | David Guillot <david@guillot.me> | 2018-07-01 23:01:54 +0200 |
commit | a84e80131a891184e234ddeee1ba0606ea898d7b (patch) | |
tree | 493d7a609192c86cb3c5b79a5e2ab8d193386f90 /lib/Controller/UserApiController.php | |
parent | ec3cc602f1bd363efe776ce4914319034d35c18e (diff) |
feat(api): support new OC core login flow
* Base ApiController now needs IUserSession and extracts/serves IUser from it
* All other API controllers now inherit from ApiController
Diffstat (limited to 'lib/Controller/UserApiController.php')
-rw-r--r-- | lib/Controller/UserApiController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Controller/UserApiController.php b/lib/Controller/UserApiController.php index cb3b8b419..2e0b04b5c 100644 --- a/lib/Controller/UserApiController.php +++ b/lib/Controller/UserApiController.php @@ -7,8 +7,10 @@ * * @author Alessandro Cosentino <cosenal@gmail.com> * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @author David Guillot <david@guillot.me> * @copyright 2012 Alessandro Cosentino * @copyright 2012-2014 Bernhard Posselt + * @copyright 2018 David Guillot */ namespace OCA\News\Controller; @@ -30,8 +32,7 @@ class UserApiController extends ApiController IUserSession $userSession, IRootFolder $rootFolder ) { - parent::__construct($appName, $request); - $this->userSession = $userSession; + parent::__construct($appName, $request, $userSession); $this->rootFolder = $rootFolder; } @@ -42,7 +43,7 @@ class UserApiController extends ApiController */ public function index() { - $user = $this->userSession->getUser(); + $user = $this->getUser(); // find the avatar $jpgAvatar = '/' . $user->getUID() . '/avatar.jpg'; |