mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-10-04 07:09:58 +00:00
This is because by default ASP.NET expects an authentication scheme to be registered when using these methods.
32 lines
No EOL
922 B
C#
32 lines
No EOL
922 B
C#
#nullable enable
|
|
using System.Net;
|
|
using LBPUnion.ProjectLighthouse.Database;
|
|
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
|
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages.ExternalAuth;
|
|
|
|
public class AuthenticationPage : BaseLayout
|
|
{
|
|
|
|
public List<PlatformLinkAttemptEntity> LinkAttempts = new();
|
|
|
|
public IPAddress? IpAddress;
|
|
public AuthenticationPage(DatabaseContext database) : base(database)
|
|
{}
|
|
|
|
public IActionResult OnGet()
|
|
{
|
|
if (this.User == null) return this.Redirect("~/login");
|
|
|
|
this.IpAddress = this.HttpContext.Connection.RemoteIpAddress;
|
|
|
|
this.LinkAttempts = this.Database.PlatformLinkAttempts
|
|
.Where(l => l.UserId == this.User.UserId)
|
|
.OrderByDescending(a => a.Timestamp)
|
|
.ToList();
|
|
|
|
return this.Page();
|
|
}
|
|
} |