From 6086b15c9f7b660829d128a666906d6b902890ee Mon Sep 17 00:00:00 2001 From: Gravita Date: Thu, 17 Mar 2022 21:27:08 +0700 Subject: [PATCH] [FIX] Deprecate RestoreSession --- .../pro/gravit/launchserver/helper/LegacySessionHelper.java | 3 +++ .../launcher/events/request/RestoreSessionRequestEvent.java | 1 + .../gravit/launcher/request/auth/RestoreSessionRequest.java | 1 + 3 files changed, 5 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/LegacySessionHelper.java b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/LegacySessionHelper.java index 29e7918d..092cf99f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/LegacySessionHelper.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/LegacySessionHelper.java @@ -36,6 +36,9 @@ public static JwtTokenInfo getJwtInfoFromAccessToken(String token, ECPublicKey p } public static String makeRefreshTokenFromPassword(String username, String rawPassword, String secretSalt) { + if(rawPassword == null) { + rawPassword = ""; + } return SecurityHelper.toHex(SecurityHelper.digest(SecurityHelper.DigestAlgorithm.SHA256, String.format("%s.%s.%s.%s", secretSalt, username, rawPassword, secretSalt))); } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RestoreSessionRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RestoreSessionRequestEvent.java index c3a4297c..70016c56 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RestoreSessionRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RestoreSessionRequestEvent.java @@ -2,6 +2,7 @@ import pro.gravit.launcher.events.RequestEvent; +@Deprecated public class RestoreSessionRequestEvent extends RequestEvent { public CurrentUserRequestEvent.UserInfo userInfo; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RestoreSessionRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RestoreSessionRequest.java index b1642b5f..4e256b6e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RestoreSessionRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RestoreSessionRequest.java @@ -7,6 +7,7 @@ import java.util.UUID; +@Deprecated public class RestoreSessionRequest extends Request implements WebSocketRequest { @LauncherNetworkAPI public final UUID session;