Encode redis password (#3720)

pull/3721/head
Thomas Kaul 3 months ago committed by GitHub
parent 5358f13e93
commit adcddae44e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -15,10 +15,14 @@ import { RedisCacheService } from './redis-cache.service';
imports: [ConfigurationModule],
inject: [ConfigurationService],
useFactory: async (configurationService: ConfigurationService) => {
const redisPassword = encodeURIComponent(
configurationService.get('REDIS_PASSWORD')
);
return <RedisClientOptions>{
store: redisStore,
ttl: configurationService.get('CACHE_TTL'),
url: `redis://:${configurationService.get('REDIS_PASSWORD')}@${configurationService.get('REDIS_HOST')}:${configurationService.get('REDIS_PORT')}/${configurationService.get('REDIS_DB')}`
url: `redis://${redisPassword ? `:${redisPassword}` : ''}@${configurationService.get('REDIS_HOST')}:${configurationService.get('REDIS_PORT')}/${configurationService.get('REDIS_DB')}`
};
}
}),

Loading…
Cancel
Save