Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config options to restrict signup on certain platforms #1077

Merged
merged 7 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,23 @@ public async Task<IActionResult> Login()
Logger.Warn($"Unknown user tried to connect username={username}", LogArea.Login);
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)
Zaprit marked this conversation as resolved.
Show resolved Hide resolved
{
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
user = await this.database.CreateUser(username, "$");
user.Password = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ public class AuthenticationConfiguration
public bool RegistrationEnabled { get; set; } = true;
public bool AutomaticAccountCreation { get; set; } = true;
public bool VerifyTickets { get; set; } = true;

public bool AllowRPCNSignup { get; set; } = true;

public bool AllowPSNSignup { get; set; } = true;
Zaprit marked this conversation as resolved.
Show resolved Hide resolved

}