mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] verifyToken
This commit is contained in:
parent
5e7230de21
commit
0283110a92
5 changed files with 5 additions and 3 deletions
|
@ -15,7 +15,7 @@ public String generateClientSecureToken() {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyClientSecureToken(String token) {
|
||||
public boolean verifyClientSecureToken(String token, String secureKey) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public static void registerHandlers() {
|
|||
public abstract String generateSecureToken(AuthResponse.AuthContext context); //Генерация токена для передачи его в LauncherGuardInterface
|
||||
|
||||
public abstract String generateClientSecureToken();
|
||||
public abstract boolean verifyClientSecureToken(String token);
|
||||
public abstract boolean verifyClientSecureToken(String token, String secureKey);
|
||||
public abstract boolean allowGetAccessToken(AuthResponse.AuthContext context);
|
||||
|
||||
public abstract void checkLaunchServerLicense(); //Выдает SecurityException при ошибке проверки лицензии
|
||||
|
|
|
@ -17,6 +17,7 @@ public class Client {
|
|||
public boolean isSecure;
|
||||
public ClientPermissions permissions;
|
||||
public String username;
|
||||
public String verifyToken;
|
||||
public LogHelper.OutputEnity logOutput;
|
||||
|
||||
public transient AuthProviderPair auth;
|
||||
|
|
|
@ -16,6 +16,7 @@ public String getType() {
|
|||
@Override
|
||||
public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception {
|
||||
String secureToken = LaunchServer.server.config.protectHandler.generateClientSecureToken();
|
||||
client.verifyToken = secureToken;
|
||||
service.sendObject(ctx, new GetSecureTokenRequestEvent(secureToken));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ public String getType() {
|
|||
|
||||
@Override
|
||||
public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception {
|
||||
boolean success = LaunchServer.server.config.protectHandler.verifyClientSecureToken(secureToken);
|
||||
boolean success = LaunchServer.server.config.protectHandler.verifyClientSecureToken(secureToken, client.verifyToken);
|
||||
if(success) client.isSecure = true;
|
||||
service.sendObject(ctx, new VerifySecureTokenRequestEvent(success));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue