mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
feat: Add new API controllers for progression events, room consumables, currencies, earnings distributions, screen share reports, subscription seasons, and UGC purchasables
- Implemented ProgressionEventsController to handle progression event retrieval and active events. - Created RoomConsumablesController for listing and purchasing room consumables. - Developed RoomCurrenciesController for managing room currencies, including creation, updates, and balance retrieval. - Added RoomEarningsDistributionsController to fetch earnings distribution data for rooms. - Introduced ScreenShareReportsController for reporting screen share incidents. - Established SubscriptionSeasonsController to provide current subscription season details and rewards. - Launched UgcPurchasablesController for managing user-generated content purchasables, including bulk operations. - Added new data entities for customization and room economy, including custom avatar items, room currencies, and UGC purchasables.
This commit is contained in:
@@ -9,6 +9,8 @@ namespace DorkNet.Server.Services;
|
||||
|
||||
public class AuthService(IConfiguration config, DorkNetDbContext db)
|
||||
{
|
||||
public const string AccessCookieName = "dorknet_access_token";
|
||||
|
||||
// Resolution order MUST match Program.cs's JwtBearer validator setup —
|
||||
// env var first, config key second — otherwise tokens are signed with
|
||||
// one secret and validated against another and every authenticated
|
||||
@@ -56,13 +58,22 @@ public class AuthService(IConfiguration config, DorkNetDbContext db)
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new(ClaimTypes.NameIdentifier, playerId.ToString()),
|
||||
new(JwtRegisteredClaimNames.Sub, playerId.ToString()),
|
||||
new("accountId", playerId.ToString()),
|
||||
new("account_id", playerId.ToString()),
|
||||
new("accountid", playerId.ToString()),
|
||||
new(ClaimTypes.Role, "gameClient"),
|
||||
new("roles", "gameClient"),
|
||||
new("token_type", tokenType),
|
||||
};
|
||||
// Multiple Role claims become a JSON array on the wire — the
|
||||
// watch's HasRole helper handles both string and List<string>
|
||||
// forms.
|
||||
if (isDev) claims.Add(new Claim(ClaimTypes.Role, "developer"));
|
||||
if (isDev)
|
||||
{
|
||||
claims.Add(new Claim(ClaimTypes.Role, "developer"));
|
||||
claims.Add(new Claim("roles", "developer"));
|
||||
}
|
||||
|
||||
var descriptor = new SecurityTokenDescriptor
|
||||
{
|
||||
|
||||
@@ -1016,6 +1016,9 @@ public class RoomService(DorkNetDbContext db)
|
||||
// showed up that the admin couldn't purge.)
|
||||
IsAGRoom = false,
|
||||
IsDormRoom = false,
|
||||
IsStudioRoom = source.IsStudioRoom,
|
||||
IsRoomLinkedToRecRoomStudio = source.IsRoomLinkedToRecRoomStudio,
|
||||
StudioSessionId = source.StudioSessionId,
|
||||
CloningAllowed = source.CloningAllowed,
|
||||
SupportsVRLow = source.SupportsVRLow,
|
||||
SupportsMobile = source.SupportsMobile,
|
||||
@@ -1070,6 +1073,9 @@ public class RoomService(DorkNetDbContext db)
|
||||
// ignored by both clients.
|
||||
IsDorm = r.IsDormRoom,
|
||||
IsDormRoom = r.IsDormRoom,
|
||||
IsStudioRoom = r.IsStudioRoom,
|
||||
IsRoomLinkedToRecRoomStudio = r.IsRoomLinkedToRecRoomStudio,
|
||||
StudioSessionId = r.StudioSessionId,
|
||||
CloningAllowed = r.CloningAllowed,
|
||||
SupportsVRLow = r.SupportsVRLow,
|
||||
SupportsMobile = r.SupportsMobile,
|
||||
|
||||
Reference in New Issue
Block a user