Integrated API tokens

This commit is contained in:
Pierre 2018-01-02 17:48:04 +01:00
parent cd49889614
commit 2bfb6fd7d1
3 changed files with 9 additions and 3 deletions

View File

@ -16,6 +16,10 @@ ComunicWeb.common.api.makeAPIrequest = function(apiURI, params, requireLoginToke
//Prepare the request URL //Prepare the request URL
var requestURL = ComunicWeb.__config.apiURL + apiURI; var requestURL = ComunicWeb.__config.apiURL + apiURI;
//Add API service tokens
params.serviceName = ComunicWeb.__config.apiServiceName;
params.serviceToken = ComunicWeb.__config.apiServiceToken;
//Add login tokens to params if required //Add login tokens to params if required
if(requireLoginTokens){ if(requireLoginTokens){
//Get login tokens //Get login tokens

View File

@ -13,5 +13,5 @@ $config['siteURL'] = "http://devweb.local/comunic/v2/";
//API config //API config
$config['API_URL'] = "http://devweb.local/comunic/api/"; $config['API_URL'] = "http://devweb.local/comunic/api/";
$config['API_SERVICE_NAME'] = "testService"; $config['API_SERVICE_NAME'] = "ComunicWeb";
$config['API_SERVICE_TOKEN'] = "testPasswd"; $config['API_SERVICE_TOKEN'] = "12XU67pJUlnNQ";

View File

@ -72,8 +72,10 @@
//Site URL //Site URL
siteURL: "<?php echo config['siteURL']; ?>", siteURL: "<?php echo config['siteURL']; ?>",
//apiURL //apiURL and credentials
apiURL: "<?php echo config['API_URL']; ?>", apiURL: "<?php echo config['API_URL']; ?>",
apiServiceName: "<?php echo config['API_SERVICE_NAME']; ?>",
apiServiceToken: "<?php echo config['API_SERVICE_TOKEN']; ?>",
//Default language //Default language
defaultLanguage: "en", defaultLanguage: "en",