Enhance signup process: increase item fetch limit, update Join API to use password, and improve UI for account creation

This commit is contained in:
Alexa
2026-06-02 02:05:01 +03:00
parent e404ed8352
commit e18e167660
7 changed files with 175 additions and 108 deletions
@@ -2582,7 +2582,13 @@ public class AdminController(
[FromQuery] string? storefront, [FromQuery] string? category,
[FromQuery] int take = 200, [FromQuery] int skip = 0)
{
take = Math.Clamp(take, 1, 500);
// Ceiling raised from 500: the wardrobe + color-variant seed pushes
// the live catalog past 800 rows, all under storefront "main". A
// 500-row window (ordered Storefront→Category→Price) silently hid
// every item that sorted past it — e.g. torso SKUs like the Sea
// Captain Contest shirt — so the admin UI couldn't find them even
// by search (it filters the fetched page client-side).
take = Math.Clamp(take, 1, 5000);
skip = Math.Max(0, skip);
IQueryable<StoreItemEntity> q = db.StoreItems;
if (!string.IsNullOrWhiteSpace(storefront)) q = q.Where(i => i.Storefront == storefront);
@@ -267,16 +267,15 @@ public class PublicSiteController(
}).ToList());
}
public sealed record JoinRedeemRequest(string? Code, string? Username, string? DeviceId);
public sealed record JoinRedeemRequest(string? Code, string? Username, string? Password);
/// <summary>POST /api/site/v1/join/redeem — redeem a signup code,
/// minting an account bound to the supplied device id. On success the
/// player relaunches the game and the watch's device-id login finds
/// the new account. Returns {ok, error?, username?}.</summary>
/// minting a username/password account. Returns {ok, error?,
/// username?}.</summary>
[HttpPost("join/redeem")]
public async Task<IActionResult> JoinRedeem([FromBody] JoinRedeemRequest body)
{
var result = await signupCodes.RedeemAsync(body.Code, body.Username, body.DeviceId);
var result = await signupCodes.RedeemAsync(body.Code, body.Username, body.Password);
if (!result.Ok)
return BadRequest(new { ok = false, error = result.Error });
return Ok(new { ok = true, username = result.Username, playerId = result.PlayerId });