<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Laravel\Socialite\Facades\Socialite;

class GoogleAuthController extends Controller
{
    //

     //
     public function redirect(){
        return Socialite::driver('google')->scopes('https://www.googleapis.com/auth/webmasters')->redirect();
    }     
     public function callback(){
      //  session_start();
            $user = Socialite::driver('google')->user();
           $_SESSION['google_token'] = $user->token;
            return  redirect('sca');

}
