app/Http/Controllers/UsuarioController.php
/**
    *   funcion que inicia sesion desde google
     */
funcion que inicia sesion desde google
funcion que inicia sesion desde google
function loginGoogle(Request $request)
    {
        header('Access-Control-Allow-Origin: *'); 
        header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
        $json = file_get_contents('php://input');
        $datos = json_decode($json);
        $usuario = User::where('email',$datos->email)->first();
        $response = [
            'estado'=>200,
            'datos' => $usuario
        ];
        header('Content-Type: application/json');
        return json_encode($response);
    }
function loginGoogle ( Request $ request ) { header ( 'Access-Control-Allow-Origin: *' ) ; header ( " Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept " ) ; $ json = file_get_contents ( 'php://input' ) ; $ datos = json_decode ( $ json ) ; $ usuario = User :: where ( 'email' , $ datos -> email ) -> first ( ) ; $ response = [ 'estado' => 200 , 'datos' => $ usuario ] ; header ( 'Content-Type: application/json' ) ; return json_encode ( $ response ) ; }
funcion que inicia sesion desde google
funcion que inicia sesion desde google