mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 00:18:39 +00:00
Add authentication page
This commit is contained in:
parent
bb742cfbbc
commit
bf759713bd
6 changed files with 70 additions and 1 deletions
|
@ -78,7 +78,9 @@
|
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MM/@EntryIndexedValue">MM</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NAT/@EntryIndexedValue">NAT</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NP/@EntryIndexedValue">NP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PS/@EntryIndexedValue">PS</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PSP/@EntryIndexedValue">PSP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RPCS/@EntryIndexedValue">RPCS</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Method/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"><ExtraRule Prefix="" Suffix="" Style="aaBb" /></Policy></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
@page "/authentication"
|
||||
@using LBPUnion.ProjectLighthouse.Types
|
||||
@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.AuthenticationPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
}
|
||||
<br>
|
||||
@foreach (AuthenticationAttempt authAttempt in Model.AuthenticationAttempts)
|
||||
{
|
||||
<div style="background-color: lightgray; display: flex; flex-direction: column; vertical-align: center; padding: 3px;">
|
||||
<p style="margin: 0px">A <b>@authAttempt.Platform</b> authentication request was logged at <b>@authAttempt.Timestamp</b> from the IP address <b>@authAttempt.IPAddress</b>.</p>
|
||||
<div>
|
||||
<a href="/">Approve</a>
|
||||
<a href="/">Deny</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
||||
{
|
||||
public class AuthenticationPage : BaseLayout
|
||||
{
|
||||
public AuthenticationPage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public List<AuthenticationAttempt> AuthenticationAttempts = new()
|
||||
{
|
||||
new AuthenticationAttempt
|
||||
{
|
||||
Platform = Platform.RPCS3,
|
||||
Timestamp = TimestampHelper.Timestamp,
|
||||
IPAddress = "127.0.0.1",
|
||||
},
|
||||
};
|
||||
|
||||
public async Task<IActionResult> OnGet()
|
||||
{
|
||||
return this.Page();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,7 +12,8 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
Model.NavigationItems.Add(new PageNavigationItem("Log out", "/logout"));
|
||||
Model.NavigationItems.Add(new PageNavigationItem("Authentication", "/authentication"));
|
||||
Model.NavigationItems.Add(new PageNavigationItem("Log out", "/logout")); // should always be last
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
ProjectLighthouse/Types/AuthenticationAttempt.cs
Normal file
10
ProjectLighthouse/Types/AuthenticationAttempt.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
namespace LBPUnion.ProjectLighthouse.Types
|
||||
{
|
||||
public class AuthenticationAttempt
|
||||
{
|
||||
public long Timestamp;
|
||||
public Platform Platform;
|
||||
public string IPAddress;
|
||||
public GameToken GameToken;
|
||||
}
|
||||
}
|
8
ProjectLighthouse/Types/Platform.cs
Normal file
8
ProjectLighthouse/Types/Platform.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace LBPUnion.ProjectLighthouse.Types
|
||||
{
|
||||
public enum Platform
|
||||
{
|
||||
PS3,
|
||||
RPCS3,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue