pass reset Small fixes (#4310)

This commit is contained in:
tooomm 2021-04-12 19:28:47 +02:00 committed by GitHub
parent 7d1f082b27
commit 88a8ee09bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 34 additions and 36 deletions

View file

@ -166,27 +166,27 @@ minpasswordlength = 6
[forgotpassword]
; Servatrice can process forgot password requests allowing users to reset their account
; Servatrice can process reset password requests allowing users to reset their account
; passwords in the event they forget it. Should this feature be enabled? Default: false.
; enable=false
; Forgot password request should not be allowed to stay valid forever. This settings
; informs servatrice how long a players forgot password reset token is valid for (in minutes).
; Reset password request should not be allowed to stay valid forever. This settings
; informs servatrice how long a players reset password reset token is valid for (in minutes).
; Default: 60
; tokenlife=60
; Servatrice can challenge users that are making forgot password requests to answer
; Servatrice can challenge users that are making reset password requests to answer
; questions in regards to their account to help validate they are the true owner of the account.
; Should this feature be enabled? Default: false
; enablechallenge=false
; Email subject for the forgot password emails
; subject="Cockatrice forgot password token"
; Email subject for the reset password emails
; subject="Cockatrice reset password token"
; Forgot password email body. You can use these tags here: %username %token
; Reset password email body. You can use these tags here: %username %token
; They will be substituted with the actual values in the email
;
; body="Hi %username, sorry to hear you forgot your password on our Cockatrice server\r\nHere's the token to use to reset your account password:\r\n\r\n%token\r\n\r\nHappy gaming!"
; body="Hi %username,\r\nthanks for reaching out to us with your password reset request for our Cockatrice server.\r\nHere's your unique token in order to reset your account password in the app:\r\n\r\n%token\r\n\r\nHappy gaming!"
[smtp]

View file

@ -285,16 +285,16 @@ bool Servatrice::initServer()
}
}
qDebug() << "Forgot password enabled: " << getEnableForgotPassword();
qDebug() << "Reset password enabled: " << getEnableForgotPassword();
if (getEnableForgotPassword()) {
qDebug() << "Forgot password token life (in minutes): " << getForgotPasswordTokenLife();
qDebug() << "Forgot password challenge on: " << getEnableForgotPasswordChallenge();
qDebug() << "Reset password token life (in minutes): " << getForgotPasswordTokenLife();
qDebug() << "Reset password challenge on: " << getEnableForgotPasswordChallenge();
}
qDebug() << "Auditing enabled: " << getEnableAudit();
if (getEnableAudit()) {
qDebug() << "Audit registration attempts enabled: " << getEnableRegistrationAudit();
qDebug() << "Audit forgot password attepts enabled: " << getEnableForgotPasswordAudit();
qDebug() << "Audit reset password attepts enabled: " << getEnableForgotPasswordAudit();
}
if (getDBTypeString() == "mysql") {

View file

@ -1249,7 +1249,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdAccountPassword(const C
Response::ResponseCode AbstractServerSocketInterface::cmdForgotPasswordRequest(const Command_ForgotPasswordRequest &cmd,
ResponseContainer &rc)
{
qDebug() << "Received forgot password request from user: " << QString::fromStdString(cmd.user_name());
qDebug() << "Received reset password request from user: " << QString::fromStdString(cmd.user_name());
if (!servatrice->getEnableForgotPassword()) {
if (servatrice->getEnableForgotPasswordAudit())
@ -1327,7 +1327,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdForgotPasswordReset(con
ResponseContainer &rc)
{
Q_UNUSED(rc);
qDebug() << "Received forgot password reset from user: " << QString::fromStdString(cmd.user_name());
qDebug() << "Received reset password reset from user: " << QString::fromStdString(cmd.user_name());
if (!sqlInterface->doesForgotPasswordExist(QString::fromStdString(cmd.user_name()))) {
if (servatrice->getEnableForgotPasswordAudit())
@ -1367,7 +1367,7 @@ AbstractServerSocketInterface::cmdForgotPasswordChallenge(const Command_ForgotPa
ResponseContainer &rc)
{
Q_UNUSED(rc);
qDebug() << "Received forgot password challenge from user: " << QString::fromStdString(cmd.user_name());
qDebug() << "Received reset password challenge from user: " << QString::fromStdString(cmd.user_name());
if (sqlInterface->doesForgotPasswordExist(QString::fromStdString(cmd.user_name()))) {
if (servatrice->getEnableForgotPasswordAudit())