other: add uid to describe API
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/672/head
parent
ddfc586465
commit
554e91d447
|
@ -111,13 +111,20 @@ class OtherController extends GenericApiController
|
||||||
$appManager = \OC::$server->get(\OCP\App\IAppManager::class);
|
$appManager = \OC::$server->get(\OCP\App\IAppManager::class);
|
||||||
$urlGenerator = \OC::$server->get(\OCP\IURLGenerator::class);
|
$urlGenerator = \OC::$server->get(\OCP\IURLGenerator::class);
|
||||||
|
|
||||||
$res = new JSONResponse([
|
$info = [
|
||||||
'version' => $appManager->getAppInfo('memories')['version'],
|
'version' => $appManager->getAppInfo('memories')['version'],
|
||||||
'baseUrl' => $urlGenerator->linkToRouteAbsolute('memories.Page.main'),
|
'baseUrl' => $urlGenerator->linkToRouteAbsolute('memories.Page.main'),
|
||||||
'loginFlowUrl' => $urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.init'),
|
'loginFlowUrl' => $urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.init'),
|
||||||
]);
|
];
|
||||||
|
|
||||||
|
try {
|
||||||
|
$info['uid'] = Util::getUID();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$info['uid'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
// This is public information
|
// This is public information
|
||||||
|
$res = new JSONResponse($info);
|
||||||
$res->addHeader('Access-Control-Allow-Origin', '*');
|
$res->addHeader('Access-Control-Allow-Origin', '*');
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
|
|
Loading…
Reference in New Issue