예제 #1
0
 public function getImport(Request $request)
 {
     $settings = $request->session()->get('redbooth');
     $redbooth = Redbooth::instance($settings);
     $projects = $redbooth->getProjectsForImport();
     return view('admin.projects.import', ['projects' => $projects]);
 }
예제 #2
0
 public function redbooth(Request $request)
 {
     $error = $request->input('error');
     $code = $request->input('code');
     if ($error) {
         $this->handleOAuthError($error);
     }
     $response = Redbooth::fetchAccessToken($code);
     $request->session()->put('redbooth.access_token', $response->access_token);
     $request->session()->put('redbooth.token_type', $response->token_type);
     $request->session()->put('redbooth.expires_in', $response->expires_in);
     $request->session()->put('redbooth.refresh_token', $response->refresh_token);
     $request->session()->put('redbooth.scope', $response->scope);
     $redbooth = Redbooth::instance($response);
     $me = $redbooth->getUser();
     $user = User::instanceFromRedbooth($me);
     $user->save();
     Auth::login($user);
     $request->session()->put('app.authenticated', true);
     return redirect('dashboard');
 }