mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 12:34:03 +00:00
32 lines
746 B
PHP
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);
|
|
}
|
|
}
|