File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,14 @@ class Auth extends CI_Controller
40
40
{
41
41
$this->load->helper('url_helper');
42
42
43
- $this->load->spark('oauth2');
43
+ $this->load->spark('oauth2/0.3.0 ');
44
44
45
45
$provider = $this->oauth2->provider($provider, array(
46
46
'id' => 'your-client-id',
47
47
'secret' => 'your-client-secret',
48
48
));
49
49
50
- if ( ! isset($_GET[ 'code'] ))
50
+ if ( ! $this->input->get( 'code'))
51
51
{
52
52
// By sending no options it'll come back here
53
53
$provider->authorize();
@@ -59,14 +59,14 @@ class Auth extends CI_Controller
59
59
{
60
60
$token = $provider->access($_GET['code']);
61
61
62
- $user = $provider->get_user_info($token->access_token );
62
+ $user = $provider->get_user_info($token);
63
63
64
64
// Here you should use this information to A) look for a user B) help a new user sign up with existing data.
65
65
// If you store it all in a cookie and redirect to a registration page this is crazy-simple.
66
66
echo "<pre >Tokens: ";
67
- var_dump($token).PHP_EOL.PHP_EOL ;
67
+ var_dump($token);
68
68
69
- echo "User Info: ";
69
+ echo "\n\nUser Info: ";
70
70
var_dump($user);
71
71
}
72
72
You can’t perform that action at this time.
0 commit comments