this is a big one so check the commit description

- auto fill storefront db from json files
- creating an account now automatically creates a doomroom room for that player
- consumables
- gift boxes
- earnable rewards from games (tokens dont work, but rro specific items do)
- purchasing items works
- some notification work, doesnt fully work iirc
This commit is contained in:
Lapis
2026-04-04 23:24:01 -04:00
parent d07de2281b
commit d831460f8f
51 changed files with 24600 additions and 2554 deletions
+22 -1
View File
@@ -106,5 +106,26 @@ public class JwtTokenService
return null;
}
}
}
public int? GetAccountIdFromContext(HttpContext context)
{
try
{
var authHeader = context.Request.Headers.Authorization.ToString();
if (string.IsNullOrEmpty(authHeader) || !authHeader.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase))
return null;
var token = authHeader.Substring("Bearer ".Length);
var accountId = ValidateAndGetAccountId(token);
if (string.IsNullOrEmpty(accountId) || !int.TryParse(accountId, out var id))
return null;
return id;
}
catch
{
return null;
}
}
}