Skip to content

Commit 122f554

Browse files
author
Phil Sturgeon
committed
Updated Readme.
1 parent 789a2af commit 122f554

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ class Auth extends CI_Controller
4040
{
4141
$this->load->helper('url_helper');
4242

43-
$this->load->spark('oauth2');
43+
$this->load->spark('oauth2/0.3.0');
4444

4545
$provider = $this->oauth2->provider($provider, array(
4646
'id' => 'your-client-id',
4747
'secret' => 'your-client-secret',
4848
));
4949

50-
if ( ! isset($_GET['code']))
50+
if ( ! $this->input->get('code'))
5151
{
5252
// By sending no options it'll come back here
5353
$provider->authorize();
@@ -59,14 +59,14 @@ class Auth extends CI_Controller
5959
{
6060
$token = $provider->access($_GET['code']);
6161

62-
$user = $provider->get_user_info($token->access_token);
62+
$user = $provider->get_user_info($token);
6363

6464
// Here you should use this information to A) look for a user B) help a new user sign up with existing data.
6565
// If you store it all in a cookie and redirect to a registration page this is crazy-simple.
6666
echo "<pre>Tokens: ";
67-
var_dump($token).PHP_EOL.PHP_EOL;
67+
var_dump($token);
6868

69-
echo "User Info: ";
69+
echo "\n\nUser Info: ";
7070
var_dump($user);
7171
}
7272

0 commit comments

Comments
 (0)