From 7d19f61b101ca30debc675018f5509fb28e3de1a Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 17 Dec 2016 15:30:58 -0800 Subject: remove facebook/instagram stuff --- controllers/auth.php | 61 ---------------------------------------------------- 1 file changed, 61 deletions(-) (limited to 'controllers/auth.php') 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'); - } -}); -- cgit v1.2.3