Skip to content

Commit

Permalink
Never expose the SecretKey to the public outside of the assembly. Red…
Browse files Browse the repository at this point in the history
…uces risk of using it as the SiteKey on a view by accident.
  • Loading branch information
jooni91 committed Feb 19, 2020
1 parent d707ab9 commit 81fff5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ReCaptcha/Configuration/RecaptchaSettings.cs
Expand Up @@ -4,6 +4,6 @@ public class RecaptchaSettings
{
public string SiteKey { get; set; } = string.Empty;

public string SecretKey { get; set; } = string.Empty;
internal string SecretKey { get; set; } = string.Empty;
}
}
3 changes: 2 additions & 1 deletion src/ReCaptcha/Extensions/RecaptchaServiceExtensions.cs
Expand Up @@ -17,7 +17,8 @@ public static IServiceCollection AddRecaptchaService(this IServiceCollection ser
{
services.AddOptions<RecaptchaSettings>()
.Configure<IConfiguration>((settings, config) =>
config.GetSection(RecaptchaServiceConstants.SettingsSectionKey).Bind(settings));
config.GetSection(RecaptchaServiceConstants.SettingsSectionKey)
.Bind(settings, (op) => op.BindNonPublicProperties = true));

services.Configure(options ??= opt => { });

Expand Down

0 comments on commit 81fff5a

Please sign in to comment.