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

fiddle with oauth flow again

Changed files
+16 -16
+16 -16
index.php
··· 225 225 $provider = new BskyProvider($options, $client, $httpFactory, $httpFactory, $httpFactory); 226 226 $provider->setPds($pds); 227 227 $name = $provider->getName(); 228 - } 229 - if (isset($_GET['login']) && $_GET['login'] === $name) { 230 - $auth_url = $provider->getAuthorizationUrl([ 231 - 'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', 232 - 'client_assertion' => $token->toString() 233 - ]); 234 - Flight::redirect($auth_url); 235 - die(1); 236 - } else if (isset($_GET['code'], $_GET['iss'])) { 237 - $storage->storeAccessToken($_GET['code'], $name); 238 - $_SESSION['sbs_'.SITE_DOMAIN.'_pds'] = $_GET['iss']; 239 - $_SESSION['sbs_'.SITE_DOMAIN.'_userinfo'] = $bskyToucher->getUserInfo(); 240 - Flight::redirect('/'); 241 - die(1); 242 - } else if (isset($_GET['error'])) { 243 - die(1); 228 + if (isset($_GET['login']) && $_GET['login'] === $name) { 229 + $auth_url = $provider->getAuthorizationUrl([ 230 + 'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', 231 + 'client_assertion' => $token->toString() 232 + ]); 233 + Flight::redirect($auth_url); 234 + die(1); 235 + } else if (isset($_GET['code'], $_GET['iss'])) { 236 + $storage->storeAccessToken($_GET['code'], $name); 237 + $_SESSION['sbs_'.SITE_DOMAIN.'_pds'] = $_GET['iss']; 238 + $_SESSION['sbs_'.SITE_DOMAIN.'_userinfo'] = $bskyToucher->getUserInfo(); 239 + Flight::redirect('/'); 240 + die(1); 241 + } else if (isset($_GET['error'])) { 242 + die(1); 243 + } 244 244 } else { 245 245 $latte = new Latte\Engine; 246 246 $latte->render('./templates/login.latte', array_merge(Flight::get('standardParams'), [