added handled for page expired 419
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||||
|
use Illuminate\Session\TokenMismatchException;
|
||||||
|
|
||||||
class VerifyCsrfToken extends Middleware
|
class VerifyCsrfToken extends Middleware
|
||||||
{
|
{
|
||||||
@@ -11,7 +12,19 @@ class VerifyCsrfToken extends Middleware
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $except = [
|
|
||||||
|
protected $except = [
|
||||||
'/pembayaran/backend'
|
'/pembayaran/backend'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function handle($request, \Closure $next)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return parent::handle($request, $next);
|
||||||
|
} catch (TokenMismatchException $e) {
|
||||||
|
// Redirect to login page if CSRF token is invalid
|
||||||
|
return redirect()->route('login')->with('logsemula', 'Sesi anda telah tamat. Sila log masuk semula.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
<!-- <div style="text-align: center;"><img src="{{ asset('/argon/img/brand/arrahnpay3.png') }}" style="text-align: center;"></div> -->
|
<!-- <div style="text-align: center;"><img src="{{ asset('/argon/img/brand/arrahnpay3.png') }}" style="text-align: center;"></div> -->
|
||||||
<h6 style="text-align: center; margin-bottom: 10%;">Log Masuk</h6>
|
<h6 style="text-align: center; margin-bottom: 10%;">Log Masuk</h6>
|
||||||
|
|
||||||
|
@if(session('logsemula'))
|
||||||
|
<div class="alert alert-primary text-center font-weight-bold" style="font-size: 13px;color:white;">
|
||||||
|
{{ session('logsemula') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<form role="#" method="post" enctype="multipart/form-data" class="login-form" novalidate="novalidate">
|
<form role="#" method="post" enctype="multipart/form-data" class="login-form" novalidate="novalidate">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="input-group input-group-outline my-3 {{ $errors->has('email') ? ' has-danger' : '' }}">
|
<div class="input-group input-group-outline my-3 {{ $errors->has('email') ? ' has-danger' : '' }}">
|
||||||
|
|||||||
Reference in New Issue
Block a user