boboko lulnar

This commit is contained in:
2026-04-20 21:07:35 +03:00
parent 57b0727788
commit 4a7eb217a1
32 changed files with 1350 additions and 858 deletions
+17 -9
View File
@@ -16,21 +16,29 @@ readonly class AuthMiddleware
private AuthService $authService,
private AccountService $accountService,
private ChannelService $channelService,
private ViewModel $viewModel
)
{
}
private ViewModel $viewModel,
) {}
public function handle(Request $request, Closure $next)
{
if (!$this->authService->isLoggedIn()) {
return redirect($this->channelService->channel->lucentUrl . "/login");
return redirect(
$this->channelService->channel->lucentUrl . "/login",
);
}
$this->authService->refreshSession();
View::share("channel",$this->channelService->channel);
View::share("user",session("user"));
View::share("schemas",$this->channelService->channel->schemas->whereIn("name",$this->accountService->currentReadableSchemas())->values());
View::share("viewModel",$this->viewModel);
View::share("channel", $this->channelService->channel);
View::share("user", toArray($this->authService->getCurrentUser()));
View::share(
"schemas",
$this->channelService->channel->schemas
->whereIn(
"name",
$this->accountService->currentReadableSchemas(),
)
->values(),
);
View::share("viewModel", $this->viewModel);
return $next($request);
}