Repository navigation
Expand file tree
/
Copy pathrefresh-token-fix.patch
More file actions
50 lines (47 loc) · 1.76 KB
/
Copy pathrefresh-token-fix.patch
File metadata and controls
50 lines (47 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/docker-compose.yml b/docker-compose.yml
index cea2c08..a37586c 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -14,8 +14,8 @@ services:
ACCESS_TOKEN_EXPIRED_IN: ${ACCESS_TOKEN_EXPIRED_IN:-1h}
REFRESH_TOKEN_EXPIRED_IN: ${REFRESH_TOKEN_EXPIRED_IN:-7d}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:5173}
- COOKIE_SECURE: ${COOKIE_SECURE:-false}
- COOKIE_SAME_SITE: ${COOKIE_SAME_SITE:-lax}
+ COOKIE_SECURE: ${COOKIE_SECURE:-true}
+ COOKIE_SAME_SITE: ${COOKIE_SAME_SITE:-none}
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_USERNAME: ${ELASTICSEARCH_USERNAME:-elastic}
ELASTICSEARCH_PASSWORD: ${ELASTICSEARCH_PASSWORD:-change_me}
diff --git a/src/app.ts b/src/app.ts
index 5467d94..07e75f4 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -32,7 +32,7 @@ app.use(express.urlencoded({ extended: true }));
app.use(
cors({
- origin: true,
+ origin: env.FRONTEND_URL,
credentials: true,
}),
);
diff --git a/src/config/env.ts b/src/config/env.ts
index bfdb46f..aabedd6 100644
--- a/src/config/env.ts
+++ b/src/config/env.ts
@@ -24,14 +24,14 @@ export default {
.default('1h')
.asString() as ms.StringValue,
- FRONTEND_URL: env.get('FRONTEND_URL').asString(),
+ FRONTEND_URL: env.get('FRONTEND_URL').default('http://localhost:5173').asString(),
COOKIE_SECURE: env
.get('COOKIE_SECURE')
- .default(isProduction ? 'true' : 'false')
+ .default('true')
.asBoolStrict(),
COOKIE_SAME_SITE: env
.get('COOKIE_SAME_SITE')
- .default(isProduction ? 'none' : 'lax')
+ .default('none')
.asEnum(['strict', 'lax', 'none']) as 'strict' | 'lax' | 'none',
ELASTICSEARCH_URL: env.get('ELASTICSEARCH_URL').default('http://localhost:9200').asUrlString(),