From 9b3b49966ad36c3ca6e8ef996c2f6a7bd6434a03 Mon Sep 17 00:00:00 2001 From: Gravita Date: Fri, 18 Mar 2022 20:03:36 +0700 Subject: [PATCH] [FIX] RefreshToken --- .../pro/gravit/launchserver/auth/core/MySQLCoreProvider.java | 2 +- .../gravit/launchserver/auth/core/PostgresSQLCoreProvider.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java index 86a5e36d..bb402dde 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java @@ -155,7 +155,7 @@ public AuthManager.AuthReport authorize(String login, AuthResponse.AuthContext c } MySQLUserSession session = new MySQLUserSession(mySQLUser); var accessToken = LegacySessionHelper.makeAccessJwtTokenFromString(mySQLUser, LocalDateTime.now(Clock.systemUTC()).plusSeconds(expireSeconds), server.keyAgreementManager.ecdsaPrivateKey); - var refreshToken = LegacySessionHelper.makeRefreshTokenFromPassword(mySQLUser.username, mySQLUser.password, server.keyAgreementManager.legacySalt); + var refreshToken = mySQLUser.username.concat(".").concat(LegacySessionHelper.makeRefreshTokenFromPassword(mySQLUser.username, mySQLUser.password, server.keyAgreementManager.legacySalt)); if (minecraftAccess) { String minecraftAccessToken = SecurityHelper.randomStringToken(); updateAuth(mySQLUser, minecraftAccessToken); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/PostgresSQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/PostgresSQLCoreProvider.java index bbbe33a0..9a7c731a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/PostgresSQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/PostgresSQLCoreProvider.java @@ -133,7 +133,7 @@ public AuthManager.AuthReport authorize(String login, AuthResponse.AuthContext c } MySQLUserSession session = new MySQLUserSession(postgresSQLUser); var accessToken = LegacySessionHelper.makeAccessJwtTokenFromString(postgresSQLUser, LocalDateTime.now(Clock.systemUTC()).plusSeconds(expireSeconds), server.keyAgreementManager.ecdsaPrivateKey); - var refreshToken = LegacySessionHelper.makeRefreshTokenFromPassword(postgresSQLUser.username, postgresSQLUser.password, server.keyAgreementManager.legacySalt); + var refreshToken = postgresSQLUser.username.concat(".").concat(LegacySessionHelper.makeRefreshTokenFromPassword(postgresSQLUser.username, postgresSQLUser.password, server.keyAgreementManager.legacySalt)); if (minecraftAccess) { String minecraftAccessToken = SecurityHelper.randomStringToken(); updateAuth(postgresSQLUser, minecraftAccessToken);