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
|
|
@ -87,7 +87,7 @@ public:
|
|||
/** @brief Decrypt the account's legacy password backup when it exists, is decryptable
|
||||
* with the configured key and has not aged out; purges it when it has. Returns the
|
||||
* legacy credential in the stored "salt + hash" format, or an empty string. */
|
||||
QString getUsableLegacyBackup(const QString &user);
|
||||
QString getUsableLegacyBackup(const QString &user) override;
|
||||
/** @brief Refresh the age window of the account's legacy password backup. */
|
||||
void touchLegacyBackup(const QString &user);
|
||||
/** @brief Drop the account's legacy password backup. */
|
||||
|
|
@ -273,9 +273,11 @@ public:
|
|||
RemoveUserBannerResult removeUserBanner(const QString &userName);
|
||||
int clearBlacklistedBanners();
|
||||
bool isCardArtAllowed(const QString &cardName, const QString &cardProviderId) override;
|
||||
bool addForgotPassword(const QString &user);
|
||||
bool addForgotPassword(const QString &user) override;
|
||||
bool removeForgotPassword(const QString &user) override;
|
||||
bool doesForgotPasswordExist(const QString &user);
|
||||
bool doesForgotPasswordExist(const QString &user) override;
|
||||
bool userTokenMatches(const QString &userName, const QString &token) override;
|
||||
bool userEmailMatches(const QString &userName, const QString &email) override;
|
||||
bool updateUserToken(const QString &token, const QString &user);
|
||||
bool validateTableColumnStringData(const QString &table,
|
||||
const QString &column,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue