Auto redirecting after login
This commit is contained in:
parent
206bcf1bc1
commit
8bb931636d
@ -1,25 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*require __DIR__ .'/vendor/autoload.php';
|
||||
|
||||
use APnutI\APnutI;
|
||||
|
||||
session_start();
|
||||
$api = new APnutI(
|
||||
'DKXEf-a9t6_1wWNnQK-bHijxLCIRXFBk',
|
||||
'mmZhbsH4KIoFkqnbIOVMktTSKypZ_QQk',
|
||||
'basic,polls,public_messages,stream,update_profile,write_post',
|
||||
'Playground',
|
||||
'http://localhost/auth_callback.php',
|
||||
'./log.log'
|
||||
);*/
|
||||
|
||||
require_once __DIR__ .'/bootstrap.php';
|
||||
|
||||
if (isset($_GET['code'])) {
|
||||
$success = $api->authenticate($_GET['code']);
|
||||
if ($success) {
|
||||
die('Welcome! <a href="index.php">Back to home</a>');
|
||||
redirect('index.php');
|
||||
} else {
|
||||
die('Echo error authenticating');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user