Skip to content

Commit

Permalink
🐛 Fix RedisAutoConfig Exclusion logic to exclude if redis session… (#…
Browse files Browse the repository at this point in the history
…10728)

* 🐛 Fix RedisAutoConfig Exclusion logic to exclude if redis session host is set

* Update property to be spring.session.store-type
  • Loading branch information
haynescd authored Apr 1, 2024
1 parent 14e00a6 commit 8361b0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ public static class Saml {}
@ConditionalOnProperty(name = "authenticate", havingValue = "oauth2")
@EnableAutoConfiguration(exclude=Saml2RelyingPartyAutoConfiguration.class)
public static class OAuth2 {}

@Configuration
@ConditionalOnProperty(name = "persistence.cache_type", havingValue = "redis", isNot = true)
@ConditionalOnExpression(
"T(org.apache.commons.lang3.StringUtils).isEmpty('${spring.session.store-type:}')"
)
@EnableAutoConfiguration(exclude=RedisAutoConfiguration.class)
public static class Redis {}

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/application.properties.EXAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,6 @@ logging.level.root=INFO

## Redis HTTP Session Store
# Redis Session
## Comment out the line below to enable redis caching
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
#spring.data.redis.host=localhost
#spring.data.redis.port=6379

Expand Down

0 comments on commit 8361b0a

Please sign in to comment.