|
|
@@ -1,8 +1,10 @@
|
|
|
package com.style24.admin.support.config;
|
|
|
|
|
|
import org.springframework.beans.factory.BeanClassLoaderAware;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
|
|
import org.springframework.data.redis.serializer.RedisSerializer;
|
|
|
import org.springframework.security.jackson2.SecurityJackson2Modules;
|
|
|
@@ -34,6 +36,9 @@ public class TsaRedisSessionConfig
|
|
|
|
|
|
private ClassLoader classLoader;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private Environment env;
|
|
|
+
|
|
|
@Override
|
|
|
public void setBeanClassLoader(ClassLoader classLoader) {
|
|
|
this.classLoader = classLoader;
|
|
|
@@ -89,10 +94,13 @@ public class TsaRedisSessionConfig
|
|
|
DefaultCookieSerializer serializer = new DefaultCookieSerializer();
|
|
|
serializer.setCookiePath("/");
|
|
|
serializer.setUseBase64Encoding(false);
|
|
|
+ String active = env.getProperty("spring.profiles.active");
|
|
|
|
|
|
- // SSL인증서 적용 시 주석 제거
|
|
|
- serializer.setUseSecureCookie(true);
|
|
|
- serializer.setSameSite("NONE");
|
|
|
+ if ("run".equals(active) || "locd".equals(active) || "style".equals(active)) {
|
|
|
+ // SSL인증서 적용 시 주석 제거
|
|
|
+ serializer.setUseSecureCookie(true);
|
|
|
+ serializer.setSameSite("NONE");
|
|
|
+ }
|
|
|
|
|
|
return serializer;
|
|
|
}
|