mirror of
				https://github.com/beestat/app.git
				synced 2025-11-03 18:37:01 -05:00 
			
		
		
		
	beestat.io, app.beestat.io, api.beestat.io, demo.beestat.io They all now work and the cookies should behave better. Fixes #134 among other things.
		
			
				
	
	
		
			30 lines
		
	
	
		
			831 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			831 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
/**
 | 
						|
 * Ecobee hits this file after authorizing. Ecobee (or maybe oauth) does not
 | 
						|
 * support URL parameters in the redirect_uri, so redirecting here and then
 | 
						|
 * redirecting again to the API. ¯\_(ツ)_/¯
 | 
						|
 *
 | 
						|
 * @author Jon Ziebell
 | 
						|
 */
 | 
						|
 | 
						|
require 'cora/setting.php';
 | 
						|
 | 
						|
$arguments = [];
 | 
						|
 | 
						|
if(isset($_GET['code']) === true) {
 | 
						|
  $arguments['code'] = $_GET['code'];
 | 
						|
}
 | 
						|
if(isset($_GET['error']) === true) {
 | 
						|
  $arguments['error'] = $_GET['error'];
 | 
						|
}
 | 
						|
if(isset($_GET['error_description']) === true) {
 | 
						|
  $arguments['error_description'] = $_GET['error_description'];
 | 
						|
}
 | 
						|
 | 
						|
$setting = cora\setting::get_instance();
 | 
						|
 | 
						|
header('Location: ' . $setting->get('beestat_root_uri') . 'api/?resource=ecobee&method=initialize&arguments=' . json_encode($arguments) . '&api_key=' . $setting->get('ecobee_api_key_local'));
 | 
						|
 | 
						|
die();
 |