Files
mixtape/zero.Web/Controllers/IndexController.cs
T

32 lines
726 B
C#
Raw Normal View History

2020-03-22 14:47:59 +01:00
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using zero.Core;
2020-04-15 14:09:52 +02:00
using zero.Core.Auth;
using zero.Core.Extensions;
2020-03-22 14:47:59 +01:00
2020-03-24 23:09:29 +01:00
namespace zero.Web.Controllers
2020-03-22 14:47:59 +01:00
{
2020-04-15 14:09:52 +02:00
[ZeroAuthorize(false)]
2020-03-22 14:47:59 +01:00
public class IndexController : BackofficeController
{
private ZeroOptions Options { get; set; }
public IndexController(IZeroConfiguration config, IOptionsMonitor<ZeroOptions> options) : base(config)
{
Options = options.CurrentValue;
}
2020-03-22 14:47:59 +01:00
public IActionResult Index()
{
if (Configuration.ZeroVersion.IsNullOrEmpty())
{
return RedirectToAction("Index", "Setup");
}
return View("/Views/Index.cshtml", Options);
2020-03-22 14:47:59 +01:00
}
}
}