You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpnamespaceApp\Middlewares;
useApp\Facades\Api;
useFirebase\JWT\JWT;
useSilver\Core\Blueprints\MiddlewareInterface;
useSilver\Core\Env;
useSilver\Http\Request;
useSilver\Http\Response;
useClosure;
useSilver\Http\Session;
useSilver\Http\Redirect;
class Migration implements MiddlewareInterface
{
// put the name to make it publicprivate$unguard = [
'unguard',
];
publicfunctionexecute(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();
}
}```
The text was updated successfully, but these errors were encountered:
Quick fix solution
The text was updated successfully, but these errors were encountered: