diff --git a/www/api.php b/www/api.php index 3eb8719ac7..1cd47d0d96 100644 --- a/www/api.php +++ b/www/api.php @@ -13,7 +13,7 @@ */ /* Set the error reporting. */ error_reporting(0); -define('RUN_MODE', 'api'); + /* Start output buffer. */ ob_start(); @@ -37,6 +37,8 @@ $common = $app->loadCommon(); $config->requestType = 'GET'; $config->default->view = 'json'; +/* Only has the api version then use apisession. Fix for passwordless login. */ +if($app->apiVersion) define('RUN_MODE', 'api'); try { $app->parseRequest(); @@ -59,4 +61,4 @@ catch (EndResponseException $endResponseException) } /* Flush the buffer. */ -echo $app->formatData(helper::removeUTF8Bom(ob_get_clean())); \ No newline at end of file +echo $app->formatData(helper::removeUTF8Bom(ob_get_clean()));