Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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;
            }
        }