Skip to content

Instantly share code, notes, and snippets.

@jonnybarnes
Created January 24, 2014 18:28
Show Gist options
  • Save jonnybarnes/8603183 to your computer and use it in GitHub Desktop.
Save jonnybarnes/8603183 to your computer and use it in GitHub Desktop.
<?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