Skip to content

Commit 1548515

Browse files
authored
Merge pull request #1221 from lowcoder-org/fix/cookie_age_env_var
Add Env Var for cookie max age:
2 parents 1cd0379 + d22d5c5 commit 1548515

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

server/api-service/lowcoder-sdk/src/main/java/org/lowcoder/sdk/config/CommonConfig.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ public static class Workspace {
137137
@Data
138138
public static class Cookie {
139139
//Set cookie max age to 1 day
140-
private long maxAgeInSeconds = Duration.ofDays(1).toSeconds();
140+
private long maxAgeInHours = 24;
141+
142+
public long getMaxAgeInSeconds() {
143+
return Duration.ofHours(maxAgeInHours).toSeconds();
144+
}
141145
}
142146

143147
@Data

server/api-service/lowcoder-server/src/main/resources/application-debug.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ common:
4545
private-mode: ${LOWCODER_MARKETPLACE_PRIVATE_MODE:true}
4646
lowcoder-public-url: ${LOWCODER_PUBLIC_URL:http://localhost:3000}
4747
notifications-email-sender: ${LOWCODER_EMAIL_NOTIFICATIONS_SENDER:info@localhost}
48+
cookie:
49+
max-age-in-hours: ${LOWCODER_COOKIE_MAX_AGE:24}
4850

4951
debug: true
5052

server/api-service/lowcoder-server/src/main/resources/application.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ common:
8686
private-mode: ${LOWCODER_MARKETPLACE_PRIVATE_MODE:true}
8787
lowcoder-public-url: ${LOWCODER_PUBLIC_URL:http://localhost:3000}
8888
notifications-email-sender: ${LOWCODER_EMAIL_NOTIFICATIONS_SENDER:info@localhost}
89+
cookie:
90+
max-age-in-hours: ${LOWCODER_COOKIE_MAX_AGE:24}
8991

9092
material:
9193
mongodb-grid-fs:

0 commit comments

Comments
 (0)