Skip to content

Commit

Permalink
refactor middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
reziamini committed Feb 28, 2021
1 parent d00037b commit d6c0e27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Http/Middleware/isAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class isAdmin

public function handle($request, Closure $next)
{
if(AuthFacade::checkIsAdmin(auth()->user()->id)){
return $next($request);
if(!AuthFacade::checkIsAdmin(auth()->user()->id)){
return redirect(config('easy_panel.redirect_unauthorized'));
}

return redirect(config('easy_panel.redirect_unauthorized'));
return $next($request);
}

}

0 comments on commit d6c0e27

Please sign in to comment.