Created
January 24, 2014 18:28
-
-
Save jonnybarnes/8603183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function indieauth() | |
{ | |
if(Input::get('token')) { | |
var_dump('has_token'); die(); //this is added for debugging | |
$token = Input::get('token'); | |
$url = 'verify?token=' . $token; | |
$guzzle = new Client('https://indieauth.com'); | |
$request = $guzzle->get($url); | |
$repsonse = $request->send(); | |
$data = $repsonse->json(); | |
if($data['me']) { | |
Session::put('me', $data['me']); | |
} else { | |
Session::put('indieauth', 'error'); | |
} | |
} else { | |
var_dump('has_not_token'); die(); //debugging also | |
} | |
return Redirect::to('notes/new'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment