diff --git a/wise-api/src/main/java/com/wisemapping/rest/AppController.java b/wise-api/src/main/java/com/wisemapping/rest/AppController.java index c36d4b0f..87acdc8e 100644 --- a/wise-api/src/main/java/com/wisemapping/rest/AppController.java +++ b/wise-api/src/main/java/com/wisemapping/rest/AppController.java @@ -57,6 +57,9 @@ public class AppController extends BaseController { @Value("${app.analytics.account:}") private String analyticsAccount; + @Value("${app.jwt.expirationMin:10080}") + private int jwtExpirationMin; + @RequestMapping(method = RequestMethod.GET, value = "/config") @ResponseStatus(value = HttpStatus.OK) public RestAppConfig appConfig() { @@ -66,6 +69,7 @@ public class AppController extends BaseController { .setGoogleOauth2Url(googleOauth2Url) .setAnalyticsAccount(analyticsAccount) .setRegistrationEnabled(isRegistrationEnabled) + .setJwtExpirationMin(jwtExpirationMin) .build(); } diff --git a/wise-api/src/main/java/com/wisemapping/rest/model/RestAppConfig.java b/wise-api/src/main/java/com/wisemapping/rest/model/RestAppConfig.java index 41dcd5b9..d4b66c92 100644 --- a/wise-api/src/main/java/com/wisemapping/rest/model/RestAppConfig.java +++ b/wise-api/src/main/java/com/wisemapping/rest/model/RestAppConfig.java @@ -39,6 +39,8 @@ public class RestAppConfig { private String recaptcha2SiteKey; private String analyticsAccount; + private int jwtExpirationMin = 10080; + RestAppConfig() { } @@ -91,6 +93,14 @@ public class RestAppConfig { this.analyticsAccount = analyticsAccount; } + public int getJwtExpirationMin() { + return jwtExpirationMin; + } + + public void setJwtExpirationMin(int jwtExpirationMin) { + this.jwtExpirationMin = jwtExpirationMin; + } + public static class RestAppConfigBuilder { private String apiBaseUrl; private String googleOauth2Url; @@ -99,6 +109,8 @@ public class RestAppConfig { private String captchaSiteKey; private String analyticsAccount; + private int jwtExpirationMin; + public RestAppConfigBuilder setCaptchaSiteKey(@NotNull String captchaSiteKey) { this.captchaSiteKey = captchaSiteKey; this.isCatchaEnabled = true; @@ -110,6 +122,11 @@ public class RestAppConfig { return this; } + public RestAppConfigBuilder setJwtExpirationMin(@NotNull int value) { + this.jwtExpirationMin = value; + return this; + } + public RestAppConfigBuilder setGoogleOauth2Url(@NotNull String googleOauth2Url) { this.googleOauth2Url = googleOauth2Url; return this; @@ -141,5 +158,4 @@ public class RestAppConfig { return result; } } - }