adjust steam auth, make neutrino post only
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -6,6 +6,6 @@ public interface ISteamAuthService
|
||||
{
|
||||
Task<SteamAuthResult> AuthorizeAsync(
|
||||
string ticket,
|
||||
uint appId,
|
||||
string appId,
|
||||
CancellationToken ct = default);
|
||||
}
|
||||
@@ -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))
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user