Fix ChangePassword Error

This commit is contained in:
xtaodada 2022-05-02 22:39:03 +08:00
parent 84f30d387d
commit 7f5a0956e9
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
27 changed files with 15 additions and 13 deletions

3
.gitignore vendored
View File

@ -30,3 +30,6 @@ out
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Ignore Gradle project-specific cache directory
.gradle/

View File

@ -1,2 +0,0 @@
#Thu Apr 28 11:29:29 WIB 2022
gradle.version=7.2

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -32,18 +32,19 @@ public class ChangePasswordHandler implements HttpContextHandler {
authResponse.success = false;
authResponse.message = "INVALID_ACCOUNT"; // ENG = "Invalid username or password"
authResponse.jwt = "";
}
if (changePasswordAccount.new_password.length() >= 8) {
String newPassword = Authentication.generateHash(changePasswordAccount.new_password);
account.setPassword(newPassword);
account.save();
authResponse.success = true;
authResponse.message = "";
authResponse.jwt = "";
} else {
authResponse.success = false;
authResponse.message = "PASSWORD_INVALID"; // ENG = "Password must be at least 8 characters long"
authResponse.jwt = "";
if (changePasswordAccount.new_password.length() >= 8) {
String newPassword = Authentication.generateHash(changePasswordAccount.new_password);
account.setPassword(newPassword);
account.save();
authResponse.success = true;
authResponse.message = "";
authResponse.jwt = "";
} else {
authResponse.success = false;
authResponse.message = "PASSWORD_INVALID"; // ENG = "Password must be at least 8 characters long"
authResponse.jwt = "";
}
}
} else {
authResponse.success = false;