Store password hash instead of plaintext for login persistence

Save SHA1(UPPER(user):UPPER(pass)) hash to login.cfg instead of the
plaintext password. On subsequent logins, use the stored hash directly
with a new authenticateWithHash() method that bypasses password hashing.
The password field shows a placeholder when using a stored hash.
This commit is contained in:
Kelsi 2026-02-05 15:09:16 -08:00
parent de8c195eaf
commit 669d89c108
6 changed files with 107 additions and 4 deletions

View file

@ -57,6 +57,11 @@ private:
float authTimer = 0.0f; // Timeout tracker
static constexpr float AUTH_TIMEOUT = 10.0f;
// Saved password hash (SHA1(UPPER(user):UPPER(pass)) as hex)
std::string savedPasswordHash;
bool usingStoredHash = false;
static constexpr const char* PASSWORD_PLACEHOLDER = "\x01\x01\x01\x01\x01\x01\x01\x01";
// Callbacks
std::function<void()> onSuccess;
std::function<void()> onSinglePlayer;