Proper Oauth for Google Home

This commit is contained in:
JonatanRek
2020-05-17 01:27:06 +02:00
parent 1af11f3f58
commit fef3c1e57f
15 changed files with 403 additions and 421 deletions

View File

@@ -14,9 +14,8 @@ if (isset($_POST) && !empty($_POST)){
header('Location: ' . BASEURL . 'setting');
die();
} else if (isset($_POST['submitEnableOta']) && $_POST['submitEnableOta'] != "") {
echo $otaCode = $_POST['otaCode'];
echo $otaSecret = $_POST['otaSecret'];
$otaCode = $_POST['otaCode'];
$otaSecret = $_POST['otaSecret'];
$ga = new PHPGangsta_GoogleAuthenticator();
$checkResult = $ga->verifyCode($otaSecret, $otaCode, 2); // 2 = 2*30sec clock tolerance