mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-11 12:42:26 +00:00
25 lines
No EOL
814 B
C#
25 lines
No EOL
814 B
C#
#nullable enable
|
|
using LBPUnion.ProjectLighthouse.Types;
|
|
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace LBPUnion.ProjectLighthouse.Website.Pages.ExternalAuth;
|
|
|
|
public class ManageUserApprovedIpAddressesPage : BaseLayout
|
|
{
|
|
public List<UserApprovedIpAddress> ApprovedIpAddresses = new();
|
|
|
|
public ManageUserApprovedIpAddressesPage(Database database) : base(database)
|
|
{}
|
|
|
|
public async Task<IActionResult> OnGet()
|
|
{
|
|
User? user = this.Database.UserFromWebRequest(this.Request);
|
|
if (user == null) return this.Redirect("/login");
|
|
|
|
this.ApprovedIpAddresses = await this.Database.UserApprovedIpAddresses.Where(a => a.UserId == user.UserId).ToListAsync();
|
|
|
|
return this.Page();
|
|
}
|
|
} |