Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed May 27, 2024
1 parent 7bdc689 commit c72499c
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ public class AppSettings : IValidatableObject

public HealthCheckSettings HealthCheckSettings { get; set; } = default!;

[Required]
public string UserProfileImagesDir { get; set; } = default!;

//#if (captcha == "reCaptcha")
[Required]
public string GoogleRecaptchaSecretKey { get; set; } = default!;
//#endif

Expand All @@ -39,8 +41,14 @@ public class IdentitySettings
{
public TimeSpan BearerTokenExpiration { get; set; }
public TimeSpan RefreshTokenExpiration { get; set; }

[Required]
public string Issuer { get; set; } = default!;

[Required]
public string Audience { get; set; } = default!;

[Required]
public string IdentityCertificatePassword { get; set; } = default!;
public bool PasswordRequireDigit { get; set; }
public int PasswordRequiredLength { get; set; }
Expand All @@ -67,6 +75,7 @@ public class IdentitySettings

public class EmailSettings
{
[Required]
public string Host { get; set; } = default!;
/// <summary>
/// If true, the web app tries to store emails as .eml file in the bin/Debug/net8.0/sent-emails folder instead of sending them using smtp server (recommended for testing purposes only).
Expand All @@ -75,18 +84,19 @@ public class EmailSettings

[Range(1, 65535)]
public int Port { get; set; }
public string UserName { get; set; } = default!;
public string Password { get; set; } = default!;
public string? UserName { get; set; }
public string? Password { get; set; }

[Required]
public string DefaultFromEmail { get; set; } = default!;
public bool HasCredential => (string.IsNullOrEmpty(UserName) is false) && (string.IsNullOrEmpty(Password) is false);
}

public class SmsSettings
{
[Phone]
public string FromPhoneNumber { get; set; } = default!;
public string? FromPhoneNumber { get; set; }

public string ConnectionString { get; set; } = default!;
public string? ConnectionString { get; set; }

public bool Configured => string.IsNullOrEmpty(FromPhoneNumber) is false && string.IsNullOrEmpty(ConnectionString) is false;
}

0 comments on commit c72499c

Please sign in to comment.