From fe0ded45efa3930557c4f50b01c81b81e919b38a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 8 Nov 2023 03:10:49 +0300 Subject: Handle premium users from Patreon --- src/main/java/com/juick/config/AppConfig.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/com/juick/config') 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() { @@ -168,6 +171,12 @@ public class AppConfig { return new TopManager(); } + @Bean + PatreonAPI patreonClient() { + return new PatreonAPI(creatorAccessToken); + } + + @Bean ViewResolver viewResolver() { PebbleViewResolver viewResolver = new PebbleViewResolver(pebbleEngine()); -- cgit v1.2.3