ProjectLighthouse/ProjectLighthouse.Servers.Website/Pages/PasswordResetRequiredPage.cshtml.cs

24 lines
No EOL
744 B
C#

#nullable enable
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages;
public class PasswordResetRequiredPage : BaseLayout
{
public PasswordResetRequiredPage(Database database) : base(database)
{}
public bool WasResetRequest { get; private set; }
public IActionResult OnGet()
{
User? user = this.Database.UserFromWebRequest(this.Request);
if (user == null) return this.Redirect("~/login");
if (!user.PasswordResetRequired) return this.Redirect("~/passwordReset");
return this.Page();
}
}