mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-22 11:35:21 +01:00
Password rules for registration.
This commit is contained in:
parent
713fdaeac1
commit
23274ef914
@ -165,7 +165,18 @@ namespace Bit.App.Pages
|
|||||||
if(string.IsNullOrWhiteSpace(PasswordCell.Entry.Text))
|
if(string.IsNullOrWhiteSpace(PasswordCell.Entry.Text))
|
||||||
{
|
{
|
||||||
await DisplayAlert(AppResources.AnErrorHasOccurred,
|
await DisplayAlert(AppResources.AnErrorHasOccurred,
|
||||||
string.Format(AppResources.ValidationFieldRequired, "Your Name"), AppResources.Ok);
|
string.Format(AppResources.ValidationFieldRequired, AppResources.MasterPassword), AppResources.Ok);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var passwordCharArray = PasswordCell.Entry.Text.ToCharArray();
|
||||||
|
if(PasswordCell.Entry.Text.Length < 8 || !passwordCharArray.Any(char.IsLetter)
|
||||||
|
|| !(passwordCharArray.Any(char.IsDigit) || passwordCharArray.Any(c => !char.IsLetterOrDigit(c))))
|
||||||
|
{
|
||||||
|
await DisplayAlert(AppResources.AnErrorHasOccurred,
|
||||||
|
"Master password must be at least 8 characters long and contain at least 1 letter and 1 number "
|
||||||
|
+ "or special character.",
|
||||||
|
AppResources.Ok);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user