Add MySQL schema dump for phpMyAdmin
This commit is contained in:
19
app/Http/Middleware/AuthMiddleware.php
Normal file
19
app/Http/Middleware/AuthMiddleware.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Core\Response;
|
||||
use App\Services\AuthService;
|
||||
|
||||
class AuthMiddleware
|
||||
{
|
||||
public function handle(array $params, callable $next): Response
|
||||
{
|
||||
$auth = AuthService::getInstance();
|
||||
if (!$auth->check()) {
|
||||
return new Response('', 302, ['Location' => '/login']);
|
||||
}
|
||||
|
||||
return $next($params);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user