Tidy Up
This commit is contained in:
parent
00d5256f43
commit
49f3d28ae9
@ -58,15 +58,11 @@ if (isset($_REQUEST["act"])){
|
|||||||
curl_setopt($request, CURLOPT_POST, 1);
|
curl_setopt($request, CURLOPT_POST, 1);
|
||||||
curl_setopt($request, CURLOPT_URL, "https://hackers.town/oauth/token");
|
curl_setopt($request, CURLOPT_URL, "https://hackers.town/oauth/token");
|
||||||
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
|
||||||
// $reqirectUri = "urn:ietf:wg:oauth:2.0:oob";
|
|
||||||
$reqirectUri = "https://tty.hackers.town/auth";
|
$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;
|
$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);
|
curl_setopt($request, CURLOPT_POSTFIELDS, $options);
|
||||||
// echo $options;
|
|
||||||
// echo json_encode($request);
|
|
||||||
$response = curl_exec($request);
|
$response = curl_exec($request);
|
||||||
curl_close($request);
|
curl_close($request);
|
||||||
// echo $response;
|
|
||||||
$Auth = json_decode($response);
|
$Auth = json_decode($response);
|
||||||
if(isset($Auth->token_type)){
|
if(isset($Auth->token_type)){
|
||||||
// Valid Auth?
|
// Valid Auth?
|
||||||
@ -161,7 +157,6 @@ if (isset($_REQUEST["act"])){
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="row copyright">
|
<div class="row copyright">
|
||||||
<!-- TODO: Make this file PHP and make the canary dependent on /etc/ttyserver/canary -->
|
|
||||||
<?php
|
<?php
|
||||||
if (file_exists("/etc/ttyserver/canary")){
|
if (file_exists("/etc/ttyserver/canary")){
|
||||||
echo "Canary";
|
echo "Canary";
|
||||||
|
4
index.js
4
index.js
@ -1,4 +1,4 @@
|
|||||||
const DEBUG = true;
|
const DEBUG = false;
|
||||||
var isMobile = false;
|
var isMobile = false;
|
||||||
|
|
||||||
const dbp = (msg) => {
|
const dbp = (msg) => {
|
||||||
@ -173,7 +173,7 @@ const beginOauth = () => {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: "https://tty.hackers.town/auth?act=id"
|
url: "https://tty.hackers.town/auth?act=id"
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
dbd(table);
|
dbd(data);
|
||||||
if(data.id){
|
if(data.id){
|
||||||
var redirect = "https://hackers.town/oauth/authorize?"+
|
var redirect = "https://hackers.town/oauth/authorize?"+
|
||||||
"response_type=code&client_id="+data.id+"&redirect_uri="+
|
"response_type=code&client_id="+data.id+"&redirect_uri="+
|
||||||
|
@ -32,8 +32,11 @@
|
|||||||
<button id="bttn" class="keyButton" onclick="beginOauth()">Create Account</button>
|
<button id="bttn" class="keyButton" onclick="beginOauth()">Create Account</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="row copyright">
|
<div class="row copyright">
|
||||||
<!-- TODO: Make this file PHP and make the canary dependent on /etc/ttyserver/canary -->
|
<?php
|
||||||
Canary
|
if (file_exists("/etc/ttyserver/canary")){
|
||||||
|
echo "Canary";
|
||||||
|
}
|
||||||
|
?>
|
||||||
<br>
|
<br>
|
||||||
Copyright ©️ 2022 Elizabeth Anne Cray
|
Copyright ©️ 2022 Elizabeth Anne Cray
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue
Block a user