Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Expose VerificationKeyStaleDurationMinutes to web.config #402

Merged
merged 2 commits into from
Jul 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,7 @@ protected virtual bool IsVerificationKeyStale(TAccount account)
return true;
}

if (account.VerificationKeySent < UtcNow.AddMinutes(-MembershipRebootConstants.UserAccount.VerificationKeyStaleDurationMinutes))
if (account.VerificationKeySent < UtcNow.AddMinutes(-Configuration.VerificationKeyStaleDurationMinutes))
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public MembershipRebootConfiguration(SecuritySettings securitySettings)
this.AllowAccountDeletion = securitySettings.AllowAccountDeletion;
this.PasswordHashingIterationCount = securitySettings.PasswordHashingIterationCount;
this.PasswordResetFrequency = securitySettings.PasswordResetFrequency;
this.VerificationKeyStaleDurationMinutes = securitySettings.VerificationKeyStaleDurationMinutes;

this.Crypto = new DefaultCrypto();
}
Expand All @@ -45,6 +46,7 @@ public MembershipRebootConfiguration(SecuritySettings securitySettings)
public bool AllowAccountDeletion { get; set; }
public int PasswordHashingIterationCount { get; set; }
public int PasswordResetFrequency { get; set; }
public int VerificationKeyStaleDurationMinutes { get; set; }

AggregateValidator<TAccount> usernameValidators = new AggregateValidator<TAccount>();
public void RegisterUsernameValidator(params IValidator<TAccount>[] items)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static SecuritySettings GetConfigSection()
private const string ALLOWACCOUNTDELETION = "allowAccountDeletion";
private const string PASSWORDHASHINGITERATIONCOUNT = "passwordHashingIterationCount";
private const string PASSWORDRESETFREQUENCY = "passwordResetFrequency";
private const string VERIFICATIONKEYSTALEDURATIONMINUTES = "verificationKeyStaleDurationMinutes";

[ConfigurationProperty(MULTITENANT, DefaultValue = MembershipRebootConstants.SecuritySettingDefaults.MultiTenant)]
public bool MultiTenant
Expand Down Expand Up @@ -128,5 +129,12 @@ public int PasswordResetFrequency
get { return (int)this[PASSWORDRESETFREQUENCY]; }
set { this[PASSWORDRESETFREQUENCY] = value; }
}

[ConfigurationProperty(VERIFICATIONKEYSTALEDURATIONMINUTES, DefaultValue = MembershipRebootConstants.UserAccount.VerificationKeyStaleDurationMinutes)]
public int VerificationKeyStaleDurationMinutes
{
get { return (int)this[VERIFICATIONKEYSTALEDURATIONMINUTES]; }
set { this[VERIFICATIONKEYSTALEDURATIONMINUTES] = value; }
}
}
}