Removed mocks for oauth mastodon

master
Bofh 1 year ago
parent bfc0bde05d
commit 564f81d5d5

@ -1,13 +1,12 @@
<?php require_once '/src/classes/database.php' ?>
<?php
# TODO: uncomment when done
if (false) {
$payload_fil = '/tmp/oauth-'.$ID;
if (!file_exists($payload_fil)) {
header('Location: /signup'); die;
}
# get mastodon auth token
$payload = json_decode(file_get_contents($payload_fil));
$ch = curl_init($payload->instance.'/oauth/token');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
@ -22,13 +21,8 @@ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$auth = curl_exec($ch);
curl_close($ch);
# get mastodon account info
$auth = @json_decode($output);
}
# TODO: remove mock when done
$payload = json_decode(file_get_contents('/src/mock-payload.mock'));
$auth = json_decode(file_get_contents('/src/mock-auth.mock'));
$output = mastodon_get($payload->instance,
'/api/v1/accounts/verify_credentials', $auth->access_token);

Loading…
Cancel
Save