mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Proper Oauth for Google Home
This commit is contained in:
1 parent
1af11f3f58
commit
fef3c1e57f
15 files changed
+403
-421
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in new issue
Block a user