mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 10:08:39 +00:00
feat: add config options to restrict signup on certain platforms
This commit is contained in:
parent
b37be0d821
commit
746bce730e
2 changed files with 22 additions and 0 deletions
|
@ -130,6 +130,23 @@ public class LoginController : ControllerBase
|
||||||
Logger.Warn($"Unknown user tried to connect username={username}", LogArea.Login);
|
Logger.Warn($"Unknown user tried to connect username={username}", LogArea.Login);
|
||||||
return this.Forbid();
|
return this.Forbid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Block RPCN signups if forbidden in config
|
||||||
|
if (npTicket.Platform == Platform.RPCS3 && !ServerConfiguration.Instance.Authentication.AllowRPCNSignup)
|
||||||
|
{
|
||||||
|
Logger.Warn(
|
||||||
|
$"New user tried to sign up via RPCN, and that is forbidden in the config, username={username}, remoteIpAddress={remoteIpAddress}",
|
||||||
|
LogArea.Login);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Block PSN signups if forbidden in config
|
||||||
|
if (npTicket.Platform == Platform.RPCS3 && !ServerConfiguration.Instance.Authentication.AllowPSNSignup)
|
||||||
|
{
|
||||||
|
Logger.Warn(
|
||||||
|
$"New user tried to sign up via PSN, and that is forbidden in the config, username={username}, remoteIpAddress={remoteIpAddress}",
|
||||||
|
LogArea.Login);
|
||||||
|
}
|
||||||
|
|
||||||
// create account for user if they don't exist
|
// create account for user if they don't exist
|
||||||
user = await this.database.CreateUser(username, "$");
|
user = await this.database.CreateUser(username, "$");
|
||||||
user.Password = null;
|
user.Password = null;
|
||||||
|
|
|
@ -5,4 +5,9 @@ public class AuthenticationConfiguration
|
||||||
public bool RegistrationEnabled { get; set; } = true;
|
public bool RegistrationEnabled { get; set; } = true;
|
||||||
public bool AutomaticAccountCreation { get; set; } = true;
|
public bool AutomaticAccountCreation { get; set; } = true;
|
||||||
public bool VerifyTickets { get; set; } = true;
|
public bool VerifyTickets { get; set; } = true;
|
||||||
|
|
||||||
|
public bool AllowRPCNSignup { get; set; } = true;
|
||||||
|
|
||||||
|
public bool AllowPSNSignup { get; set; } = true;
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue