Exemplo n.º 1
0
 public function token(Guard $auth)
 {
     try {
         $accessToken = $auth->facebookAuth(Input::get('code'));
         return response()->json(['user' => ['name' => Auth::user()->name, 'facebookId' => Auth::user()->facebookId, 'id' => Auth::user()->id], 'token_type' => 'bearer', 'access_token' => $accessToken]);
     } catch (\Exception $e) {
         Log::error("Exception occured, code: " . $e->getCode() . " with message: " . $e->getMessage());
     }
     return response('Bad request.', 400);
 }