mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] JsonCoreProvider verifyPassword
This commit is contained in:
parent
7e77862cd4
commit
9fff11e887
1 changed files with 6 additions and 4 deletions
|
@ -132,16 +132,16 @@ public void verifyAuth(AuthResponse.AuthContext context) throws AuthException {
|
||||||
public PasswordVerifyReport verifyPassword(User user, AuthRequest.AuthPasswordInterface password) {
|
public PasswordVerifyReport verifyPassword(User user, AuthRequest.AuthPasswordInterface password) {
|
||||||
JsonUser jsonUser = (JsonUser) user;
|
JsonUser jsonUser = (JsonUser) user;
|
||||||
if (password instanceof AuthPlainPassword && jsonUser.password != null && passwordVerifier != null) {
|
if (password instanceof AuthPlainPassword && jsonUser.password != null && passwordVerifier != null) {
|
||||||
if (passwordVerifier.check(((AuthPlainPassword) password).password, jsonUser.password)) {
|
if (passwordVerifier.check(jsonUser.password, ((AuthPlainPassword) password).password)) {
|
||||||
return PasswordVerifyReport.OK;
|
return PasswordVerifyReport.OK;
|
||||||
} else {
|
} else {
|
||||||
return PasswordVerifyReport.FAILED;
|
return PasswordVerifyReport.FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
return jsonRequest(new JsonPasswordVerify(null, null), verifyPasswordUrl, PasswordVerifyReport.class);
|
return jsonRequest(new JsonPasswordVerify(null, null, password), verifyPasswordUrl, PasswordVerifyReport.class);
|
||||||
}
|
}
|
||||||
return jsonRequest(new JsonPasswordVerify(user.getUsername(), user.getUUID()), verifyPasswordUrl, PasswordVerifyReport.class);
|
return jsonRequest(new JsonPasswordVerify(user.getUsername(), user.getUUID(), password), verifyPasswordUrl, PasswordVerifyReport.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -225,10 +225,12 @@ public AuthManager.AuthReport toAuthReport() {
|
||||||
public static class JsonPasswordVerify {
|
public static class JsonPasswordVerify {
|
||||||
public String username;
|
public String username;
|
||||||
public UUID uuid;
|
public UUID uuid;
|
||||||
|
public AuthRequest.AuthPasswordInterface password;
|
||||||
|
|
||||||
public JsonPasswordVerify(String username, UUID uuid) {
|
public JsonPasswordVerify(String username, UUID uuid, AuthRequest.AuthPasswordInterface password) {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
|
this.password = password;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue