* @license Proprietary */ class Authentication { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle($request, Closure $next) { // if the session does not contain the token, redirect back to the login if (auth()->check() === false) { return redirect()->route('login')->withErrors('Your session has expired. Please log in again.'); } return $next($request); } }