- Integra ASP.NET Core Identity: login/password, lockout brute-force, cookie sicuri, password policy forte - Seed automatico utente admin da variabili ambiente (fallback password temporanea forte) - Tutte le pagine principali ora protette con [Authorize] e redirect automatico a /login - Nuovo layout login/logout pulito senza sidebar, spinner durante redirect - NavMenu mostra utente autenticato e logout - Rimosse credenziali Bidoo da env/Docker: ora solo cookie sessione da UI - Aggiornata documentazione: sicurezza, deploy, backup, troubleshooting - Fix NavigationException, SectionRegistry, errori header read-only - Versione incrementata a 1.2.0, pronto per deploy production Tailscale/Unraid
37 lines
889 B
Plaintext
37 lines
889 B
Plaintext
@page "/health"
|
|
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
|
@inject DatabaseService DatabaseService
|
|
@inject AuctionMonitor AuctionMonitor
|
|
|
|
@code {
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
try
|
|
{
|
|
// Verifica database
|
|
var dbHealthy = await DatabaseService.CheckDatabaseHealthAsync();
|
|
|
|
// Verifica servizi
|
|
var auctionsCount = AuctionMonitor.GetAuctions().Count;
|
|
|
|
if (dbHealthy)
|
|
{
|
|
// Ritorna 200 OK
|
|
await Task.CompletedTask;
|
|
}
|
|
else
|
|
{
|
|
// Ritorna 500 Internal Server Error
|
|
throw new Exception("Database health check failed");
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
// Healthcheck fallito
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
|
|
OK
|