<?php

namespace Televox\Http\Middleware;

use Closure;

class CheckUserIsLogged
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return mixed
     */
    public function handle($request, Closure $next)
    {

        if ($request->session()->has('logueado')) {
            return redirect(config('app.url') . '/Grabaciones');
        } else {
            return $next($request);
        }

    }
}
