Proper Oauth for Google Home

This commit is contained in:
jonatanrek committed 2020-05-17 01:27:06 +02:00
1 parent 1af11f3f58
commit fef3c1e57f
15 files changed
+403 -421

No files matched your search

+10
View File
@@ -206,5 +206,15 @@ class UserManager
return false;
}
}
public static function setOta($otaCode, $otaSecret){
$ga = new PHPGangsta_GoogleAuthenticator();
$checkResult = $ga->verifyCode($otaSecret, $otaCode, 2); // 2 = 2*30sec clock tolerance
if ($checkResult) {
self::setUserData('ota', $otaSecret);
return true;
}
return false;
}
}
?>