mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[FIX] Хуки авторизации распространяются и на серверную авторизацию
This commit is contained in:
parent
9145243b8c
commit
0c5227b5ab
1 changed files with 3 additions and 0 deletions
|
@ -56,7 +56,9 @@ public void reply() throws Exception {
|
||||||
else pair = server.config.getAuthProviderPair(auth_id);
|
else pair = server.config.getAuthProviderPair(auth_id);
|
||||||
if(pair == null) requestError("Auth type not found");
|
if(pair == null) requestError("Auth type not found");
|
||||||
AuthProvider provider = pair.provider;
|
AuthProvider provider = pair.provider;
|
||||||
|
AuthResponse.AuthContext context = new AuthResponse.AuthContext(session, login, password.length(), null, client, null, ip, true);
|
||||||
try {
|
try {
|
||||||
|
server.authHookManager.preHook(context, clientData);
|
||||||
result = provider.auth(login, password, ip);
|
result = provider.auth(login, password, ip);
|
||||||
if (!VerifyHelper.isValidUsername(result.username)) {
|
if (!VerifyHelper.isValidUsername(result.username)) {
|
||||||
AuthProvider.authError(String.format("Illegal result: '%s'", result.username));
|
AuthProvider.authError(String.format("Illegal result: '%s'", result.username));
|
||||||
|
@ -77,6 +79,7 @@ public void reply() throws Exception {
|
||||||
}
|
}
|
||||||
clientData.type = Client.Type.SERVER;
|
clientData.type = Client.Type.SERVER;
|
||||||
clientData.username = result.username;
|
clientData.username = result.username;
|
||||||
|
server.authHookManager.postHook(context, clientData);
|
||||||
} catch (AuthException | HWIDException e) {
|
} catch (AuthException | HWIDException e) {
|
||||||
requestError(e.getMessage());
|
requestError(e.getMessage());
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue