Browse Source

Encode redis password (#3720)

pull/3721/head
Thomas Kaul 5 months ago
committed by GitHub
parent
commit
adcddae44e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      apps/api/src/app/redis-cache/redis-cache.module.ts

6
apps/api/src/app/redis-cache/redis-cache.module.ts

@ -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