public async Task RegisterAsync() { RegisterResponse response = await Api.RegisterAsync(new RegisterRequest(UserName, Password)); if (response.IsSuccess) { if (await UserState.LoginAsync(UserName, Password)) { Navigator.OpenTimeline(); } UserName = null; Password = null; } else { ErrorMessages.AddRange(response.ErrorMessages); } }
protected async Task LoginAsync() { Log.Debug($"UserName: '******'"); Log.Debug($"Password: '******'"); IsValid = true; if (String.IsNullOrEmpty(UserName) || String.IsNullOrEmpty(Password) || !await UserState.LoginAsync(UserName, Password, IsPersistent)) { IsValid = false; } }