diff --git a/src/main/java/app/utils/SaltedCookie.java b/src/main/java/app/utils/SaltedCookie.java index 907c55c..f4f2379 100644 --- a/src/main/java/app/utils/SaltedCookie.java +++ b/src/main/java/app/utils/SaltedCookie.java @@ -4,6 +4,7 @@ import app.updates.CountriesUpdater; import jakarta.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.util.DigestUtils; @@ -16,10 +17,15 @@ public class SaltedCookie { @Value("${backend.auth.salt}") private String salt; - private HashMap secret_keys = new HashMap<>(); + private HashMap secret_keys; private final Logger logger = LoggerFactory.getLogger(SaltedCookie.class); + @Autowired + public SaltedCookie() { + secret_keys = new HashMap<>(); + } + public String Hashed(String value) { return DigestUtils.md5DigestAsHex(String.format("%s+%s", value, salt).getBytes()); }