Files
izyim/app/Http/Middleware/Authentication.php
omair saleh 8a28eb1790 Revert "Merge branch 'dashboardReport' into 'master'"
This reverts merge request !5
2019-03-19 09:57:38 +00:00

32 lines
746 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
/**
* Class Authentication
*
* Copyright (C) 2018 buduxs. All rights reserved.
* @author Omair Saleh <uldvstar@gmail.com>
* @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);
}
}