mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-30 00:38:38 +00:00
Move all irrelevant Pages out of ExternalAuth
This commit is contained in:
parent
f974c90a92
commit
4b69192e89
11 changed files with 31 additions and 12 deletions
|
@ -14,8 +14,8 @@ using IOFile = System.IO.File;
|
|||
namespace LBPUnion.ProjectLighthouse.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("LITTLEBIGPLANETPS3_XML/")]
|
||||
[Produces("text/xml")]
|
||||
[Route("LITTLEBIGPLANETPS3_XML")]
|
||||
public class ResourcesController : ControllerBase
|
||||
{
|
||||
[HttpPost("showModerated")]
|
||||
|
@ -39,6 +39,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
return this.Ok(LbpSerializer.StringElement("resources", resources));
|
||||
}
|
||||
|
||||
[HttpGet("/gameAssets/{hash}")]
|
||||
[HttpGet("r/{hash}")]
|
||||
public IActionResult GetResource(string hash)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@page "/"
|
||||
@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.LandingPage
|
||||
@model LBPUnion.ProjectLighthouse.Pages.LandingPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
|
@ -5,7 +5,7 @@ using LBPUnion.ProjectLighthouse.Helpers;
|
|||
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
||||
namespace LBPUnion.ProjectLighthouse.Pages
|
||||
{
|
||||
public class LandingPage : BaseLayout
|
||||
{
|
|
@ -1,5 +1,5 @@
|
|||
@page "/login"
|
||||
@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.LoginForm
|
||||
@model LBPUnion.ProjectLighthouse.Pages.LoginForm
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
|
@ -7,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
||||
namespace LBPUnion.ProjectLighthouse.Pages
|
||||
{
|
||||
public class LoginForm : BaseLayout
|
||||
{
|
||||
|
@ -19,9 +19,9 @@ namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
|||
[UsedImplicitly]
|
||||
public async Task<IActionResult> OnGet([FromQuery] string username, [FromQuery] string password)
|
||||
{
|
||||
WasLoginRequest = !string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password);
|
||||
this.WasLoginRequest = !string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password);
|
||||
|
||||
if (WasLoginRequest)
|
||||
if (this.WasLoginRequest)
|
||||
{
|
||||
User? user = await this.Database.Users.FirstOrDefaultAsync(u => u.Username == username);
|
||||
if (user == null) return this.StatusCode(403, "");
|
|
@ -1,5 +1,5 @@
|
|||
@page "/logout"
|
||||
@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.LogoutPage
|
||||
@model LBPUnion.ProjectLighthouse.Pages.LogoutPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
|
@ -4,7 +4,7 @@ using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
|||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
||||
namespace LBPUnion.ProjectLighthouse.Pages
|
||||
{
|
||||
public class LogoutPage : BaseLayout
|
||||
{
|
8
ProjectLighthouse/Pages/PhotosPage.cshtml
Normal file
8
ProjectLighthouse/Pages/PhotosPage.cshtml
Normal file
|
@ -0,0 +1,8 @@
|
|||
@page
|
||||
@model LBPUnion.ProjectLighthouse.Pages.PhotosPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
}
|
||||
|
||||
<h1>Photos</h1>
|
10
ProjectLighthouse/Pages/PhotosPage.cshtml.cs
Normal file
10
ProjectLighthouse/Pages/PhotosPage.cshtml.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages
|
||||
{
|
||||
public class PhotosPage : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
{}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
@page "/register"
|
||||
@model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.RegisterForm
|
||||
@model LBPUnion.ProjectLighthouse.Pages.RegisterForm
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
|
@ -7,7 +7,7 @@ using LBPUnion.ProjectLighthouse.Types;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
||||
namespace LBPUnion.ProjectLighthouse.Pages
|
||||
{
|
||||
public class RegisterForm : BaseLayout
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
|||
{
|
||||
this.WasRegisterRequest = !string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(confirmPassword);
|
||||
|
||||
if (WasRegisterRequest)
|
||||
if (this.WasRegisterRequest)
|
||||
{
|
||||
if (password != confirmPassword) return this.BadRequest();
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue