From 2d0957f8347dfb061a80589cdaba38d6afd4171b Mon Sep 17 00:00:00 2001 From: Gravita Date: Tue, 9 Nov 2021 12:22:18 +0700 Subject: [PATCH] [FIX] MemoryAuthCoreProvider --- .../pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java | 2 +- .../gravit/launchserver/auth/core/MemoryAuthCoreProvider.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java index 732f8b95..08de95c8 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java @@ -198,7 +198,7 @@ public void init(LaunchServer server) { if(authorizeUrl == null) { throw new IllegalArgumentException("'authorizeUrl' can't be null"); } - if((checkServerUrl == null && joinServerUrl == null) || updateServerIdUrl == null) { + if(checkServerUrl == null && joinServerUrl == null && updateServerIdUrl == null) { throw new IllegalArgumentException("Please set 'checkServerUrl' and 'joinServerUrl' or 'updateServerIdUrl'"); } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java index c3c83db6..14d17bb7 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java @@ -83,7 +83,7 @@ public AuthManager.AuthReport authorize(String login, AuthResponse.AuthContext c memory.add(user); } } - if(minecraftAccess) { + if(!minecraftAccess) { return AuthManager.AuthReport.ofOAuth(user.accessToken, null, 0, new MemoryUserSession(user)); } else { return AuthManager.AuthReport.ofOAuthWithMinecraft(user.accessToken, user.accessToken, null, 0, new MemoryUserSession(user));