mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Serve password reset from the database interface (#7842)
cmdForgotPasswordRequest, continuePasswordRequest, cmdForgotPasswordReset, cmdForgotPasswordChallenge, cmdRequestPasswordSalt and cmdSubmitPasswordVerifier still called Servatrice_DatabaseInterface, and two of them validated the account token and email through the generic validateTableColumnStringData helper. Add doesForgotPasswordExist, addForgotPassword and getUsableLegacyBackup to Server_DatabaseInterface with fail-closed defaults, replace the table/column probes with userTokenMatches and userEmailMatches using the same statement and case-insensitive comparison, and let the commands ask the injected interface. Audit records, check order and every response code are unchanged.
This commit is contained in:
parent
d05198101d
commit
9b00972b4d
4 changed files with 54 additions and 18 deletions
|
|
@ -3552,6 +3552,16 @@ bool Servatrice_DatabaseInterface::validateTableColumnStringData(const QString &
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::userTokenMatches(const QString &userName, const QString &token)
|
||||
{
|
||||
return validateTableColumnStringData("{prefix}_users", "token", userName, token);
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::userEmailMatches(const QString &userName, const QString &email)
|
||||
{
|
||||
return validateTableColumnStringData("{prefix}_users", "email", userName, email);
|
||||
}
|
||||
|
||||
void Servatrice_DatabaseInterface::addAuditRecord(const QString &user,
|
||||
const QString &ipaddress,
|
||||
const QString &clientid,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue