Exemplo n.º 1
0
        private async Task TrySignupPasswordAsync()
        {
            IsAuthenticating = true;
            var        authManager = ServiceContainer.Resolve <AuthManager> ();
            AuthResult authRes;

            try {
                authRes = await authManager.SignupAsync(EmailEditText.Text, PasswordEditText.Text);
            } catch (InvalidOperationException ex) {
                var log = ServiceContainer.Resolve <ILogger> ();
                log.Info(LogTag, ex, "Failed to signup user with password.");
                return;
            } finally {
                IsAuthenticating = false;
            }

            if (authRes != AuthResult.Success)
            {
                EmailEditText.RequestFocus();

                ShowAuthError(EmailEditText.Text, authRes, Mode.Signup);
            }
            else
            {
                // Start the initial sync for the user
                ServiceContainer.Resolve <ISyncManager> ().Run();
            }

            StartAuthActivity();
        }
Exemplo n.º 2
0
        private async void TrySignupPassword()
        {
            IsAuthenticating = true;
            var  authManager = ServiceContainer.Resolve <AuthManager> ();
            bool success;

            try {
                success = await authManager.Signup(EmailEditText.Text, PasswordEditText.Text);
            } catch (InvalidOperationException ex) {
                var log = ServiceContainer.Resolve <Logger> ();
                log.Info(LogTag, ex, "Failed to signup user with password.");
                return;
            } finally {
                IsAuthenticating = false;
            }

            if (!success)
            {
                EmailEditText.RequestFocus();

                new SignupFailedDialogFragment().Show(FragmentManager, "invalid_credentials_dialog");
            }
            else
            {
                // Start the initial sync for the user
                ServiceContainer.Resolve <ISyncManager> ().Run(SyncMode.Full);
            }

            StartAuthActivity();
        }
Exemplo n.º 3
0
        private async Task TrySignupPasswordAsync()
        {
            var authRes = await ViewModel.TrySignupPasswordAsync(EmailEditText.Text, PasswordEditText.Text);

            if (authRes != AuthResult.Success)
            {
                EmailEditText.RequestFocus();

                ShowAuthError(EmailEditText.Text, authRes, Mode.Signup);
            }
        }
Exemplo n.º 4
0
        private async void TrySignupPassword()
        {
            IsAuthenticating = true;
            var authManager = ServiceContainer.Resolve <AuthManager> ();
            var success     = await authManager.Signup(EmailEditText.Text, PasswordEditText.Text);

            IsAuthenticating = false;

            if (!success)
            {
                EmailEditText.RequestFocus();

                new SignupFailedDialogFragment().Show(FragmentManager, "invalid_credentials_dialog");
            }

            StartAuthActivity();
        }