✨ 支持外部自定义 Cache 缓存 state
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package com.xkcoding.justauth;
|
||||
|
||||
import com.xkcoding.justauth.properties.JustAuthProperties;
|
||||
import me.zhyd.oauth.cache.AuthDefaultStateCache;
|
||||
import me.zhyd.oauth.cache.AuthStateCache;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -20,8 +23,14 @@ public class JustAuthAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "justauth", value = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
public AuthRequestFactory authRequestFactory(JustAuthProperties properties) {
|
||||
return new AuthRequestFactory(properties);
|
||||
public AuthRequestFactory authRequestFactory(JustAuthProperties properties, AuthStateCache authStateCache) {
|
||||
return new AuthRequestFactory(properties, authStateCache);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(AuthStateCache.class)
|
||||
public AuthStateCache authStateCache() {
|
||||
return AuthDefaultStateCache.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user