Skip to content

Commit 4570cbc

Browse files
committed
Accept password not set in redis
1 parent f1c943f commit 4570cbc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Common/Extensions/ConfigurationExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public static ConfigurationOptions RegisterRedisOptions(this WebApplicationBuild
4343
{
4444
if (string.IsNullOrEmpty(section.Host)) throw new InvalidOperationException("Redis Host field is required if no connectionstring is specified (OpenShock:Redis:Host).");
4545
if (string.IsNullOrEmpty(section.User)) throw new InvalidOperationException("Redis User field is required if no connectionstring is specified (OpenShock:Redis:User).");
46-
if (string.IsNullOrEmpty(section.Password)) throw new InvalidOperationException("Redis Password field is required if no connectionstring is specified (OpenShock:Redis:Password).");
4746

4847
// Parse port with sane default + validation
4948
ushort port = 6379;
@@ -56,7 +55,7 @@ public static ConfigurationOptions RegisterRedisOptions(this WebApplicationBuild
5655
options = new ConfigurationOptions
5756
{
5857
User = section.User,
59-
Password = section.Password,
58+
Password = section.Password ?? string.Empty,
6059
Ssl = false,
6160
EndPoints = { { section.Host, port } },
6261
};

0 commit comments

Comments
 (0)