-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Quick fix solution
<?php
namespace App\Middlewares;
use App\Facades\Api;
use Firebase\JWT\JWT;
use Silver\Core\Blueprints\MiddlewareInterface;
use Silver\Core\Env;
use Silver\Http\Request;
use Silver\Http\Response;
use Closure;
use Silver\Http\Session;
use Silver\Http\Redirect;
class Migration implements MiddlewareInterface
{
// put the name to make it public
private $unguard = [
'unguard',
];
public function execute(Request $req, Response $res, Closure $next)
{
if ($req->route() == null) {
return $next();
}
if (!array_search($req->route()->middleware(), $this->unguard) !== false) {
if(ENV::get('local') == 'local')
return $next();
//Change here if you want to check if someone is loggin in owherwise use Error 404;
return \Silver\Http\View::error('404');
}
return $next();
}
}```Metadata
Metadata
Assignees
Labels
No labels