This commit is contained in:
2022-05-08 00:15:19 +00:00
parent 00d5256f43
commit 49f3d28ae9
3 changed files with 7 additions and 9 deletions

View File

@@ -58,15 +58,11 @@ if (isset($_REQUEST["act"])){
curl_setopt($request, CURLOPT_POST, 1);
curl_setopt($request, CURLOPT_URL, "https://hackers.town/oauth/token");
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
// $reqirectUri = "urn:ietf:wg:oauth:2.0:oob";
$reqirectUri = "https://tty.hackers.town/auth";
$options = "grant_type=authorization_code&code=".$MastCode."&client_id=".$config->oauth->key."&client_secret=".$config->oauth->secret."&scope=read:accounts&redirect_uri=".$reqirectUri;
curl_setopt($request, CURLOPT_POSTFIELDS, $options);
// echo $options;
// echo json_encode($request);
$response = curl_exec($request);
curl_close($request);
// echo $response;
$Auth = json_decode($response);
if(isset($Auth->token_type)){
// Valid Auth?
@@ -161,7 +157,6 @@ if (isset($_REQUEST["act"])){
</form>
</div>
<div class="row copyright">
<!-- TODO: Make this file PHP and make the canary dependent on /etc/ttyserver/canary -->
<?php
if (file_exists("/etc/ttyserver/canary")){
echo "Canary";