From 554e91d447ed5de3f5c04bf19a7c63aa73019e7f Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 17 May 2023 22:41:53 -0700 Subject: [PATCH] other: add uid to describe API Signed-off-by: Varun Patil --- lib/Controller/OtherController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Controller/OtherController.php b/lib/Controller/OtherController.php index 74ce4812..c807b830 100644 --- a/lib/Controller/OtherController.php +++ b/lib/Controller/OtherController.php @@ -111,13 +111,20 @@ class OtherController extends GenericApiController $appManager = \OC::$server->get(\OCP\App\IAppManager::class); $urlGenerator = \OC::$server->get(\OCP\IURLGenerator::class); - $res = new JSONResponse([ + $info = [ 'version' => $appManager->getAppInfo('memories')['version'], 'baseUrl' => $urlGenerator->linkToRouteAbsolute('memories.Page.main'), 'loginFlowUrl' => $urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.init'), - ]); + ]; + + try { + $info['uid'] = Util::getUID(); + } catch (\Exception $e) { + $info['uid'] = null; + } // This is public information + $res = new JSONResponse($info); $res->addHeader('Access-Control-Allow-Origin', '*'); return $res;