aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/config
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-11-08 03:10:49 +0300
committerGravatar Vitaly Takmazov2023-11-08 03:35:01 +0300
commitfe0ded45efa3930557c4f50b01c81b81e919b38a (patch)
treeced4d83ab229d1270fbfb9773620daf13e0c25a6 /src/main/java/com/juick/config
parentdfad691d92d55d8b458665ca7b810d4fae2d3089 (diff)
Handle premium users from Patreon
Diffstat (limited to 'src/main/java/com/juick/config')
-rw-r--r--src/main/java/com/juick/config/AppConfig.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/juick/config/AppConfig.java b/src/main/java/com/juick/config/AppConfig.java
index 32926bd1..2963ee27 100644
--- a/src/main/java/com/juick/config/AppConfig.java
+++ b/src/main/java/com/juick/config/AppConfig.java
@@ -28,6 +28,7 @@ import com.mitchellbosecke.pebble.extension.FormatterExtension;
import com.overzealous.remark.Options;
import com.overzealous.remark.Remark;
+import com.patreon.PatreonAPI;
import io.pebbletemplates.pebble.PebbleEngine;
import io.pebbletemplates.pebble.loader.ClasspathLoader;
import io.pebbletemplates.pebble.loader.Loader;
@@ -65,6 +66,8 @@ public class AppConfig {
private Resource keystore;
@Value("${keystore_password:secret}")
private String keystorePassword;
+ @Value("${patreon_creator_access_token:secret}")
+ private String creatorAccessToken;
@Bean
KeystoreManager keystoreManager() {
@@ -169,6 +172,12 @@ public class AppConfig {
}
@Bean
+ PatreonAPI patreonClient() {
+ return new PatreonAPI(creatorAccessToken);
+ }
+
+
+ @Bean
ViewResolver viewResolver() {
PebbleViewResolver viewResolver = new PebbleViewResolver(pebbleEngine());
viewResolver.setPrefix("templates");