mirror of
https://github.com/bitwarden/android.git
synced 2025-01-11 18:57:39 +03:00
password gen fixes
This commit is contained in:
parent
e875b530b1
commit
64c301caeb
1 changed files with 6 additions and 6 deletions
|
@ -29,8 +29,8 @@ namespace Bit.App.Services
|
||||||
int? minNumbers = null,
|
int? minNumbers = null,
|
||||||
int? minSpecial = null)
|
int? minSpecial = null)
|
||||||
{
|
{
|
||||||
int minUppercaseValue = minUppercase.GetValueOrDefault(1),
|
int minUppercaseValue = minUppercase.GetValueOrDefault(0),
|
||||||
minLowercaseValue = minLowercase.GetValueOrDefault(1),
|
minLowercaseValue = minLowercase.GetValueOrDefault(0),
|
||||||
minNumbersValue = minNumbers.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorMinNumbers, 1)),
|
minNumbersValue = minNumbers.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorMinNumbers, 1)),
|
||||||
minSpecialValue = minSpecial.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorMinSpecial, 1)),
|
minSpecialValue = minSpecial.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorMinSpecial, 1)),
|
||||||
lengthValue = length.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10));
|
lengthValue = length.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10));
|
||||||
|
@ -42,19 +42,19 @@ namespace Bit.App.Services
|
||||||
ambiguousValue = ambiguous.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorAmbiguous, false));
|
ambiguousValue = ambiguous.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorAmbiguous, false));
|
||||||
|
|
||||||
// Sanitize
|
// Sanitize
|
||||||
if(uppercaseValue && minUppercaseValue < 0)
|
if(uppercaseValue && minUppercaseValue <= 0)
|
||||||
{
|
{
|
||||||
minUppercaseValue = 1;
|
minUppercaseValue = 1;
|
||||||
}
|
}
|
||||||
if(lowercaseValue && minLowercaseValue < 0)
|
if(lowercaseValue && minLowercaseValue <= 0)
|
||||||
{
|
{
|
||||||
minLowercaseValue = 1;
|
minLowercaseValue = 1;
|
||||||
}
|
}
|
||||||
if(numbersValue && minNumbersValue < 0)
|
if(numbersValue && minNumbersValue <= 0)
|
||||||
{
|
{
|
||||||
minNumbersValue = 1;
|
minNumbersValue = 1;
|
||||||
}
|
}
|
||||||
if(specialValue && minSpecialValue < 0)
|
if(specialValue && minSpecialValue <= 0)
|
||||||
{
|
{
|
||||||
minSpecialValue = 1;
|
minSpecialValue = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue