diff options
author | Aaron Parecki <aaron@parecki.com> | 2016-12-17 15:30:58 -0800 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2016-12-17 15:30:58 -0800 |
commit | 7d19f61b101ca30debc675018f5509fb28e3de1a (patch) | |
tree | 16067e41f86d6aa99045d71795724a1e9d21dd7c /controllers/auth.php | |
parent | efd82f8ff808f9e9b706e978c04eb77cdb463886 (diff) |
remove facebook/instagram stuff
Diffstat (limited to 'controllers/auth.php')
-rw-r--r-- | controllers/auth.php | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/controllers/auth.php b/controllers/auth.php index f339ed4..c4efb1d 100644 --- a/controllers/auth.php +++ b/controllers/auth.php @@ -256,25 +256,6 @@ $app->get('/signout', function() use($app) { }); -/* -$app->post('/auth/facebook', function() use($app) { - if($user=require_login($app, false)) { - $params = $app->request()->params(); - // User just auth'd with facebook, store the access token - $user->facebook_access_token = $params['fb_token']; - $user->save(); - - $app->response()->body(json_encode(array( - 'result' => 'ok' - ))); - } else { - $app->response()->body(json_encode(array( - 'result' => 'error' - ))); - } -}); -*/ - $app->post('/auth/twitter', function() use($app) { if($user=require_login($app, false)) { $params = $app->request()->params(); @@ -360,45 +341,3 @@ $app->get('/auth/twitter/callback', function() use($app) { $app->redirect('/settings'); } }); - -$app->get('/auth/instagram', function() use($app) { - if($user=require_login($app, false)) { - - $instagram = instagram_client(); - - // If there is an existing Instagram auth token, check if it's valid - if($user->instagram_access_token) { - $instagram->setAccessToken($user->instagram_access_token); - $igUser = $instagram->getUser(); - - if($igUser && $igUser->meta->code == 200) { - $app->response()['Content-type'] = 'application/json'; - $app->response()->body(json_encode(array( - 'result' => 'ok', - 'username' => $igUser->data->username, - 'url' => $instagram->getLoginUrl(array('basic','likes')) - ))); - return; - } - } - - $app->response()['Content-type'] = 'application/json'; - $app->response()->body(json_encode(array( - 'result' => 'error', - 'url' => $instagram->getLoginUrl(array('basic','likes')) - ))); - } -}); - -$app->get('/auth/instagram/callback', function() use($app) { - if($user=require_login($app)) { - $params = $app->request()->params(); - - $instagram = instagram_client(); - $data = $instagram->getOAuthToken($params['code']); - $user->instagram_access_token = $data->access_token; - $user->save(); - - $app->redirect('/settings'); - } -}); |