mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Integrated API tokens
This commit is contained in:
		@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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";
 | 
				
			||||||
@@ -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",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user