mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge pull request #10164 from snipe/fixes/require_revalidation_on_logout_back_button
Force revalidation headers when user logs out
This commit is contained in:
commit
536b5717f0
|
@ -23,6 +23,7 @@ class Kernel extends HttpKernel
|
|||
\App\Http\Middleware\CheckForDebug::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
\App\Http\Middleware\SecurityHeaders::class,
|
||||
\App\Http\Middleware\PreventBackHistory::class,
|
||||
|
||||
];
|
||||
|
||||
|
|
23
app/Http/Middleware/PreventBackHistory.php
Normal file
23
app/Http/Middleware/PreventBackHistory.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
class PreventBackHistory
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
return $response->header('Cache-Control','no-cache, no-store, max-age=0, must-revalidate')
|
||||
->header('Pragma','no-cache')
|
||||
->header('Expires','Sun, 02 Jan 1990 00:00:00 GMT');
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue