mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-23 13:41:31 +00:00
Redesign authentication page
This commit is contained in:
parent
e0156400b8
commit
d609291d8f
2 changed files with 36 additions and 3 deletions
|
@ -14,8 +14,22 @@
|
|||
else
|
||||
{
|
||||
<p>You have @Model.AuthenticationAttempts.Count authentication attempts pending.</p>
|
||||
@if (Model.IpAddress != null)
|
||||
{
|
||||
<p>This device's IP address is <b>@(Model.IpAddress.ToString())</b>. If this matches with an authentication attempt below, then it's safe to assume the authentication attempt came from the same network as this device.</p>
|
||||
}
|
||||
|
||||
<a href="/authentication/autoApprovals">
|
||||
<button class="ui small blue button">
|
||||
<i class="cog icon"></i>
|
||||
<span>Manage automatically approved IP addresses</span>
|
||||
</button>
|
||||
</a>
|
||||
<a href="/authentication/denyAll">
|
||||
<button class="ui small red button">Deny all</button>
|
||||
<button class="ui small red button">
|
||||
<i class="x icon"></i>
|
||||
<span>Deny all</span>
|
||||
</button>
|
||||
</a>
|
||||
}
|
||||
|
||||
|
@ -25,11 +39,23 @@ else
|
|||
<div class="ui red segment">
|
||||
<p>A <b>@authAttempt.Platform</b> authentication request was logged at <b>@timestamp.ToString("MM/dd/yyyy @ h:mm tt") UTC</b> from the IP address <b>@authAttempt.IPAddress</b>.</p>
|
||||
<div>
|
||||
<a href="/authentication/autoApprove/@authAttempt.AuthenticationAttemptId">
|
||||
<button class="ui tiny green button">
|
||||
<i class="check icon"></i>
|
||||
<span>Automatically approve every time</span>
|
||||
</button>
|
||||
</a>
|
||||
<a href="/authentication/approve/@authAttempt.AuthenticationAttemptId">
|
||||
<button class="ui tiny green button">Approve</button>
|
||||
<button class="ui tiny yellow button">
|
||||
<i class="check icon"></i>
|
||||
<span>Approve this time</span>
|
||||
</button>
|
||||
</a>
|
||||
<a href="/authentication/deny/@authAttempt.AuthenticationAttemptId">
|
||||
<button class="ui tiny red button">Deny</button>
|
||||
<button class="ui tiny red button">
|
||||
<i class="x icon"></i>
|
||||
<span>Deny</span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#nullable enable
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
|
@ -13,12 +15,17 @@ namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
|||
{
|
||||
|
||||
public List<AuthenticationAttempt> AuthenticationAttempts;
|
||||
|
||||
public IPAddress? IpAddress;
|
||||
public AuthenticationPage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public async Task<IActionResult> OnGet()
|
||||
{
|
||||
if (!ServerSettings.Instance.UseExternalAuth) return this.NotFound();
|
||||
if (this.User == null) return this.StatusCode(403, "");
|
||||
|
||||
this.IpAddress = this.HttpContext.Connection.RemoteIpAddress;
|
||||
|
||||
this.AuthenticationAttempts = this.Database.AuthenticationAttempts.Include
|
||||
(a => a.GameToken)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue