Add user authentication and account management system

Features:
- User registration with username, email, password
- Login with JWT token authentication
- Password hashing with BCrypt
- Account settings & management
- Device linking to accounts
- Change password & password reset
- Account-User relationship (1-to-1 with game data)

Database entities:
- Account: User accounts with credentials
- DeviceAccount: Link devices to accounts (many-to-many)

API endpoints:
- POST /api/auth/register
- POST /api/auth/login
- POST /api/auth/change-password
- POST /api/auth/forgot-password
- POST /api/auth/reset-password
- GET /api/auth/me
- POST /api/auth/link-device
- DELETE /api/auth/unlink-device/{deviceId}

Starting resources for new accounts:
- 100,000 Gold
- 500,000 Cash
- Level 1

Ready for VPS deployment with HTTPS.
This commit is contained in:
2026-02-19 15:00:16 -08:00
parent 8ba7c605f1
commit a6bab92282
7 changed files with 633 additions and 0 deletions

View File

@@ -10,6 +10,8 @@ public class RR3DbContext : DbContext
public DbSet<Device> Devices { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<Session> Sessions { get; set; }
public DbSet<Account> Accounts { get; set; }
public DbSet<DeviceAccount> DeviceAccounts { get; set; }
public DbSet<Purchase> Purchases { get; set; }
public DbSet<CatalogItem> CatalogItems { get; set; }
public DbSet<DailyReward> DailyRewards { get; set; }