File tree Expand file tree Collapse file tree
src/main/kotlin/fi/hsl/jore4/auth/audit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package fi.hsl.jore4.auth.audit
22
3+ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
34import org.springframework.data.jpa.repository.JpaRepository
45import org.springframework.stereotype.Repository
56
67/* *
78 * Repository for login records.
89 */
910@Repository
11+ @ConditionalOnProperty(prefix = " session" , name = [" enabled" ], havingValue = " true" )
1012interface LoginAuditRepository : JpaRepository <LoginAudit , Long >
Original file line number Diff line number Diff line change @@ -2,17 +2,18 @@ package fi.hsl.jore4.auth.audit
22
33import org.slf4j.Logger
44import org.slf4j.LoggerFactory
5- import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
5+ import org.springframework.beans.factory.annotation.Autowired
6+ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
67import org.springframework.stereotype.Service
78import org.springframework.transaction.annotation.Transactional
89
910/* *
1011 * Service for logging login events.
11- * Only enabled when JPA is available.
1212 */
1313@Service
14- @ConditionalOnBean( LoginAuditRepository :: class )
14+ @ConditionalOnProperty(prefix = " session " , name = [ " enabled " ], havingValue = " true " )
1515open class LoginAuditService (
16+ @Autowired(required = true )
1617 private val loginAuditRepository : LoginAuditRepository
1718) {
1819 companion object {
You can’t perform that action at this time.
0 commit comments