mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 10:08:39 +00:00
Fix code review suggestions
This commit is contained in:
parent
b026da3bad
commit
d34e6a7b1c
2 changed files with 10 additions and 4 deletions
|
@ -17,8 +17,14 @@ namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers.Login;
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("LITTLEBIGPLANETPS3_XML/login")]
|
[Route("LITTLEBIGPLANETPS3_XML/login")]
|
||||||
[Produces("text/xml")]
|
[Produces("text/xml")]
|
||||||
public class LoginController(DatabaseContext database) : ControllerBase
|
public class LoginController : ControllerBase
|
||||||
{
|
{
|
||||||
|
private readonly DatabaseContext database;
|
||||||
|
public LoginController(DatabaseContext database)
|
||||||
|
{
|
||||||
|
this.database = database;
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> Login()
|
public async Task<IActionResult> Login()
|
||||||
{
|
{
|
||||||
|
@ -51,13 +57,13 @@ public class LoginController(DatabaseContext database) : ControllerBase
|
||||||
|
|
||||||
string username = npTicket.Username;
|
string username = npTicket.Username;
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(username))
|
if (string.IsNullOrEmpty(username))
|
||||||
{
|
{
|
||||||
Logger.Warn("Unable to determine username, rejecting login", LogArea.Login);
|
Logger.Warn("Unable to determine username, rejecting login", LogArea.Login);
|
||||||
return this.Forbid();
|
return this.Forbid();
|
||||||
}
|
}
|
||||||
|
|
||||||
await database.RemoveExpiredTokens();
|
await this.database.RemoveExpiredTokens();
|
||||||
|
|
||||||
UserEntity? user;
|
UserEntity? user;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ public class ServerConfiguration : ConfigurationBase<ServerConfiguration>
|
||||||
// This is so Lighthouse can properly identify outdated configurations and update them with newer settings accordingly.
|
// This is so Lighthouse can properly identify outdated configurations and update them with newer settings accordingly.
|
||||||
// If you are modifying anything here, this value MUST be incremented.
|
// If you are modifying anything here, this value MUST be incremented.
|
||||||
// Thanks for listening~
|
// Thanks for listening~
|
||||||
public override int ConfigVersion { get; set; } = 26;
|
public override int ConfigVersion { get; set; } = 27;
|
||||||
|
|
||||||
public override string ConfigName { get; set; } = "lighthouse.yml";
|
public override string ConfigName { get; set; } = "lighthouse.yml";
|
||||||
public string WebsiteListenUrl { get; set; } = "http://localhost:10060";
|
public string WebsiteListenUrl { get; set; } = "http://localhost:10060";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue