mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] Фикс пермишшенов в MySQLAuthProvider RequestAuthProvider
This commit is contained in:
parent
4adb51f6cf
commit
c865a8fec8
3 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
package ru.gravit.launchserver.auth.provider;
|
||||
|
||||
import ru.gravit.launcher.ClientPermissions;
|
||||
import ru.gravit.launchserver.LaunchServer;
|
||||
import ru.gravit.launchserver.auth.AuthException;
|
||||
import ru.gravit.launchserver.auth.MySQLSourceConfig;
|
||||
import ru.gravit.utils.helper.CommonHelper;
|
||||
|
@ -35,7 +36,7 @@ public AuthProviderResult auth(String login, String password, String ip) throws
|
|||
// Execute SQL query
|
||||
s.setQueryTimeout(MySQLSourceConfig.TIMEOUT);
|
||||
try (ResultSet set = s.executeQuery()) {
|
||||
return set.next() ? new AuthProviderResult(set.getString(1), SecurityHelper.randomStringToken(), usePermission ? new ClientPermissions(set.getLong(2)) : new ClientPermissions()) : authError(message);
|
||||
return set.next() ? new AuthProviderResult(set.getString(1), SecurityHelper.randomStringToken(), usePermission ? new ClientPermissions(set.getLong(2)) : LaunchServer.server.config.permissionsHandler.getPermissions(set.getString(1))) : authError(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ru.gravit.launchserver.auth.provider;
|
||||
|
||||
import ru.gravit.launcher.ClientPermissions;
|
||||
import ru.gravit.launchserver.LaunchServer;
|
||||
import ru.gravit.utils.helper.CommonHelper;
|
||||
import ru.gravit.utils.helper.IOHelper;
|
||||
import ru.gravit.utils.helper.LogHelper;
|
||||
|
@ -31,7 +32,7 @@ public AuthProviderResult auth(String login, String password, String ip) throws
|
|||
// Match username
|
||||
Matcher matcher = pattern.matcher(currentResponse);
|
||||
return matcher.matches() && matcher.groupCount() >= 1 ?
|
||||
new AuthProviderResult(matcher.group("username"), SecurityHelper.randomStringToken(), usePermission ? new ClientPermissions(Long.getLong(matcher.group("permission"))) : new ClientPermissions()) :
|
||||
new AuthProviderResult(matcher.group("username"), SecurityHelper.randomStringToken(), usePermission ? new ClientPermissions(Long.getLong(matcher.group("permission"))) : LaunchServer.server.config.permissionsHandler.getPermissions(login)) :
|
||||
authError(currentResponse);
|
||||
}
|
||||
|
||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
|||
Subproject commit 53106ee20700cb73ad65fd7dddf69b0d0b766f4c
|
||||
Subproject commit 38e11640ce4a4ed3e9745718db02a888770a22bb
|
Loading…
Reference in a new issue