private Task ConfirmPasswordAsync(SignUpInputContext context) { if (context.Text != GetText(passwordTitle)) { context.ErrorMessage = "Passwords don't match"; } else { context.ErrorMessage = null; } return(Task.CompletedTask); }
private async Task PasswordAsync(SignUpInputContext context) { if (string.IsNullOrWhiteSpace(context.Text)) { context.ErrorMessage = "Enter a password"; return; } if (!Inputs.Any(i => i.Title == confPasswordTitle)) { Inputs.Add(BuildConfPasswordContext()); } }
private async Task VerifyEmailAsync(SignUpInputContext context) { context.Text = context.Text.Trim(); if (string.IsNullOrWhiteSpace(context.Text)) { context.ErrorMessage = "Enter your email"; return; } bool exists = await _apiConsumer.VerifyAccountEmailAsync(context.Text); if (exists) { context.ErrorMessage = "There is already an account registered with this account"; } else { if (!Inputs.Any(i => i.Title == usernameTitle)) { Inputs.Add(BuildUsernameContext()); } } }
private async Task VerifyUsernameAsync(SignUpInputContext context) { context.Text = context.Text.Trim(); if (string.IsNullOrWhiteSpace(context.Text)) { context.ErrorMessage = "Enter a username"; return; } bool exists = await _apiConsumer.VerifyAccountUsernameAsync(context.Text); if (exists) { context.ErrorMessage = "Username is taken!"; } else { if (!Inputs.Any(i => i.Title == passwordTitle)) { Inputs.Add(BuildPasswordContext()); } } }