コード例 #1
0
        public async Task ClickTokenButton()
        {
            bool createResult;

            IsLoading = true;
            try
            {
                // TODO: Create Public/Private Key
                var result = await _authManager.CreateUserDeviceViaEmail(EmailAddress, Token, "test", "Test");

                if (result != null)
                {
                    var accessToken = await _authManager.Authenticate(result.UserDeviceId, result.AccessToken);

                    createResult = accessToken != null;
                }
                else
                {
                    createResult = false;
                }
            }
            catch (Exception ex)
            {
                ChatDebugger.SendMessageDialogAsync(ex.Message, ex);
                createResult = false;
            }
            IsLoading = false;
            RaiseEvent(createResult ? UserCreatedSuccessful : UserCreatedFailed, EventArgs.Empty);
        }
コード例 #2
0
        public async Task ClickSignupButton()
        {
            bool signupResult;

            IsLoading = true;
            try
            {
                signupResult = await _authManager.GetTokenEmail(EmailAddress);
            }
            catch (Exception ex)
            {
                ChatDebugger.SendMessageDialogAsync(ex.Message, ex);
                signupResult = false;
            }
            IsLoading = false;
            RaiseEvent(signupResult ? TokenSentSuccessful : TokenSentFailed, EventArgs.Empty);
        }