Permalink
Browse files

refactor of auto generated password

  • Loading branch information...
ninianne98 committed Nov 18, 2018
1 parent 8408141 commit fc36bacaecb3ad6219b3840c58393ec974183ca0
Showing with 4 additions and 4 deletions.
  1. +4 −4 CMSCore/Security/SecurityData.cs
@@ -708,18 +708,18 @@ where u.Email.Contains(email)
private static string alphaUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
private static string alphaLower = "abcdefghijklmnopqrstuvwxyz";
private static string numericChars = "1234567890";
private static string specialChars = "@#$&%";
private static string specialChars = "@#$%}{";
private static string allChars = alphaUpper + alphaLower + numericChars + specialChars;
private static int _length = -1;
private static int MinRequiredPasswordLength {
private static int GeneratedPasswordLength {
get {
if (_length <= 3) {
CarrotSecurityConfig config = CarrotSecurityConfig.GetConfig();
_length = config.PasswordValidator.RequiredLength;
if (_length <= 9) {
if (_length <= 8) {
_length = 12;
}
}
@@ -729,7 +729,7 @@ where u.Email.Contains(email)
}
public static string GenerateSimplePassword() {
int length = MinRequiredPasswordLength;
int length = GeneratedPasswordLength;
Random rand = new Random();
string generatedPassword = String.Empty;

0 comments on commit fc36bac

Please sign in to comment.