diff --git a/services/auth-service/src/main/java/com/sourcefuse/jarc/services/authservice/oauth2/auth/utils/StateUtils.java b/services/auth-service/src/main/java/com/sourcefuse/jarc/services/authservice/oauth2/auth/utils/StateUtils.java index 29e87755..e4eb40e0 100644 --- a/services/auth-service/src/main/java/com/sourcefuse/jarc/services/authservice/oauth2/auth/utils/StateUtils.java +++ b/services/auth-service/src/main/java/com/sourcefuse/jarc/services/authservice/oauth2/auth/utils/StateUtils.java @@ -10,6 +10,7 @@ public final class StateUtils { public static final String CLIENT_ID_PARAM_KEY = "clientId"; + private static final Gson gson = new Gson(); private StateUtils() {} @@ -33,7 +34,7 @@ public static String decode(String encodedState) { @SuppressWarnings("unchecked") // Convert the JSON string to a Map - Map dataMap = new Gson().fromJson(decodedString, Map.class); + Map dataMap = gson.fromJson(decodedString, Map.class); // Retrieve and return the state from the map return (String) dataMap.get(CLIENT_ID_PARAM_KEY);