Use TLS in production

This commit is contained in:
2025-07-03 16:30:12 -04:00
parent d27b36a969
commit 86710657df

View File

@@ -7,7 +7,7 @@ export abstract class BaseRedisRepository {
redisClient = createClient({ redisClient = createClient({
url: process.env.REDIS_URL, url: process.env.REDIS_URL,
socket: { socket: {
tls: (process.env.REDIS_URL?.match(/rediss:/) != null), tls: process.env.NODE_ENV === 'production',
rejectUnauthorized: false, rejectUnauthorized: false,
} }
}), }),
@@ -30,4 +30,4 @@ export abstract class BaseRedisRepository {
public async clearAllData() { public async clearAllData() {
await this.redisClient.flushAll(); await this.redisClient.flushAll();
} }
} }