Delete Middleware PreventBackHistory
This commit is contained in:
parent
c284d7792a
commit
f6331d5f13
|
@ -36,7 +36,7 @@ class Kernel extends HttpKernel
|
|||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\PreventBackHistory::class,
|
||||
// \App\Http\Middleware\PreventBackHistory::class,
|
||||
|
||||
],
|
||||
|
||||
|
@ -66,11 +66,12 @@ class Kernel extends HttpKernel
|
|||
'signed' => \App\Http\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'PreventBackHistory' =>\App\Http\Middleware\PreventBackHistory::class,
|
||||
'role' => \App\Http\Middleware\CheckRole::class,
|
||||
// 'PreventBackHistory' =>\App\Http\Middleware\PreventBackHistory::class,
|
||||
];
|
||||
|
||||
protected $routeMiddleware = [
|
||||
// ...
|
||||
'role' => \App\Http\Middleware\CheckRole::class,
|
||||
// 'role' => \App\Http\Middleware\CheckRole::class,
|
||||
];
|
||||
}
|
||||
|
|
|
@ -13,16 +13,11 @@ class CheckRole
|
|||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle($request, Closure $next, $role)
|
||||
public function handle(Request $request, Closure $next, ...$roles)
|
||||
{
|
||||
if (!$request->user() || $request->user()->role != $role) {
|
||||
return redirect()->route('home');
|
||||
}
|
||||
if ($request->user() && in_array($request->user()->role, $roles)) {
|
||||
return $next($request);
|
||||
// if (auth()->check() && auth()->user()->role === $role) {
|
||||
// return $next($request);
|
||||
// }
|
||||
|
||||
// return redirect('/login');
|
||||
}
|
||||
return redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@ class PreventBackHistory
|
|||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
// $response = $next($request);
|
||||
|
||||
return $response->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0')
|
||||
->header('Pragma', 'no-cache')
|
||||
->header('Expires', '0');
|
||||
// return $response->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0')
|
||||
// ->header('Pragma', 'no-cache')
|
||||
// ->header('Expires', '0');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,6 @@
|
|||
<th>Kriteria</th>
|
||||
<th>Sub Kriteria</th>
|
||||
<th>Deskripsi</th>
|
||||
<th>Prioritas</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -140,7 +139,6 @@
|
|||
<td>{{ $subcriteria->criteria->nama }}</td>
|
||||
<td>{{ $subcriteria->nama }}</td>
|
||||
<td>{{ $subcriteria->deskripsi }}</td>
|
||||
<td>{{ $subcriteria->prioritas }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
|
|
|
@ -73,17 +73,7 @@
|
|||
Route::get('/reset-password/{token}', [AuthController::class, 'showResetForm'])->name('password.reset');
|
||||
Route::post('/reset-password', [AuthController::class, 'resetPassword'])->name('password.update');
|
||||
|
||||
// Route::middleware(['auth', 'role:wakil_kepala'])->group(function () {
|
||||
// Route::get('/wakil_kepala/dashboard', [WakilKepalaController::class, 'dashboard'])->name('wakil_kepala.dashboard');
|
||||
// Route::get('/wakil_kepala/kriteria', [WakilKepalaController::class, 'kriteria'])->name('wakil_kepala.kriteria');
|
||||
// Route::get('/wakil_kepala/subkriteria', [WakilKepalaController::class, 'subkriteria'])->name('wakil_kepala.subkriteria');
|
||||
// });
|
||||
|
||||
// Route::middleware(['auth', 'role:siswa'])->group(function () {
|
||||
// Route::get('/siswa/dashboard', [SiswaController::class, 'dashboard'])->name('siswa.dashboard');
|
||||
// });
|
||||
|
||||
Route::middleware(['auth','web','PreventBackHistory'])->group(function () {
|
||||
Route::middleware(['auth','web'])->group(function () {
|
||||
// Route::get('/dashboard', function () {
|
||||
// return view('dashboard.index');
|
||||
// })->name('dashboard.index');
|
||||
|
|
Loading…
Reference in New Issue