permissions
This commit is contained in:
@@ -4,22 +4,27 @@ namespace Lucent\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Lucent\Account\AccountService;
|
||||
use Lucent\Account\AuthService;
|
||||
use Lucent\Channel\ChannelService;
|
||||
|
||||
readonly class AuthMiddleware
|
||||
{
|
||||
public function __construct(private AuthService $authService, private ChannelService $channelService)
|
||||
public function __construct(
|
||||
private AccountService $accountService,
|
||||
private AuthService $authService,
|
||||
private ChannelService $channelService
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
|
||||
if (!$this->authService->isLoggedIn()) {
|
||||
return redirect($this->channelService->channel->lucentUrl . "/login");
|
||||
}
|
||||
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user