friendship ended with social-app. php is my new best friend

Compare changes

Choose any two refs to compare.

Changed files
+20 -16
templates
+16 -16
index.php
···
$provider = new BskyProvider($options, $client, $httpFactory, $httpFactory, $httpFactory);
$provider->setPds($pds);
$name = $provider->getName();
-
}
-
if (isset($_GET['login']) && $_GET['login'] === $name) {
-
$auth_url = $provider->getAuthorizationUrl([
-
'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
-
'client_assertion' => $token->toString()
-
]);
-
Flight::redirect($auth_url);
-
die(1);
-
} else if (isset($_GET['code'], $_GET['iss'])) {
-
$storage->storeAccessToken($_GET['code'], $name);
-
$_SESSION['sbs_'.SITE_DOMAIN.'_pds'] = $_GET['iss'];
-
$_SESSION['sbs_'.SITE_DOMAIN.'_userinfo'] = $bskyToucher->getUserInfo();
-
Flight::redirect('/');
-
die(1);
-
} else if (isset($_GET['error'])) {
-
die(1);
+
if (isset($_GET['login']) && $_GET['login'] === $name) {
+
$auth_url = $provider->getAuthorizationUrl([
+
'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
+
'client_assertion' => $token->toString()
+
]);
+
Flight::redirect($auth_url);
+
die(1);
+
} else if (isset($_GET['code'], $_GET['iss'])) {
+
$storage->storeAccessToken($_GET['code'], $name);
+
$_SESSION['sbs_'.SITE_DOMAIN.'_pds'] = $_GET['iss'];
+
$_SESSION['sbs_'.SITE_DOMAIN.'_userinfo'] = $bskyToucher->getUserInfo();
+
Flight::redirect('/');
+
die(1);
+
} else if (isset($_GET['error'])) {
+
die(1);
+
}
} else {
$latte = new Latte\Engine;
$latte->render('./templates/login.latte', array_merge(Flight::get('standardParams'), [
+4
templates/layout.latte
···
data-theme="{$setTheme}"
data-font="{$setFont}"
>
+
<!--
+
{print_r($_SESSION)}
+
{print_r(PHP_SESSION_DISABLED)}
+
-->
<div id="page">
<header>
<h1><a href="/">{include '_partials/logo.latte'}{$siteTitle}</a></h1>