mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-05 10:12:27 +00:00
23 lines
No EOL
674 B
C#
23 lines
No EOL
674 B
C#
#nullable enable
|
|
using LBPUnion.ProjectLighthouse.Types;
|
|
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace LBPUnion.ProjectLighthouse.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();
|
|
}
|
|
} |