adjust steam auth, make neutrino post only

This commit is contained in:
Holden
2026-06-20 17:49:44 -05:00
parent e24a4c6872
commit 04498c7e6f
5 changed files with 6 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ public class NeutrinoController(
private readonly NeutrinoOptions _options = options.Value;
// Photon sends the request with Content-Type: text/plain instead of application/json.
[Route("authorize")]
[HttpPost("authorize")]
public async Task<ActionResult<NeutrinoAuthenticateResponse>> AuthorizeNeutrinoAsync(
[FromQuery(Name = "secret")] string? secret = null,
CancellationToken ct = default)

View File

@@ -6,6 +6,6 @@ public interface ISteamAuthService
{
Task<SteamAuthResult> AuthorizeAsync(
string ticket,
uint appId,
string appId,
CancellationToken ct = default);
}

View File

@@ -16,7 +16,7 @@ public class SteamAuthService(
public async Task<SteamAuthResult> AuthorizeAsync(
string ticket,
uint appId,
string appId,
CancellationToken ct = default)
{
if (string.IsNullOrWhiteSpace(ticket))

View File

@@ -30,7 +30,7 @@ public class SteamAuthValidator(ISteamAuthService steamAuthService) : IPlatformA
if (steamParams?.AppId is null || string.IsNullOrWhiteSpace(steamParams.Ticket))
return PlatformAuthResult.Failure("Invalid authentication");
var result = await steamAuthService.AuthorizeAsync(steamParams.Ticket, steamParams.AppId.AppId, ct);
var result = await steamAuthService.AuthorizeAsync(steamParams.Ticket, steamParams.AppId, ct);
if (!result.Succeeded || result.SteamId is null)
return PlatformAuthResult.Failure("Invalid authentication");
@@ -46,13 +46,6 @@ public class SteamAuthValidator(ISteamAuthService steamAuthService) : IPlatformA
{
public required string Ticket { get; set; }
public required SteamAppIdAuth AppId { get; set; }
}
// Splooty, why did you set it up like this ;-;
private sealed class SteamAppIdAuth
{
[JsonPropertyName("m_AppId")]
public required uint AppId { get; set; }
public required string AppId { get; set; }
}
}

View File

@@ -3,5 +3,5 @@
public class SteamOptions
{
public string ApiKey { get; set; } = string.Empty;
public uint AppId { get; set; } = 480; // Spacewar
public string AppId { get; set; } = "480"; // Spacewar
}