コード例 #1
0
        private bool AssignNewRecoveryToken()
        {
            AccountVerificationServiceClient accountVerificationServiceClient =
                new AccountVerificationServiceClient();

            return(accountVerificationServiceClient.AssignNewRecoveryToken(_emailAddress, _verificationToken));
        }
コード例 #2
0
        private bool TokenIsCorrect()
        {
            string token = TokenTextBox.Text;

            if (token == "")
            {
                return(false);
            }
            AccountVerificationServiceClient accountVerificationServiceClient =
                new AccountVerificationServiceClient();

            return(accountVerificationServiceClient.VerifyRecoveryToken(_emailAddress, token));
        }
コード例 #3
0
        private void SendNewCode()
        {
            string newToken = TokenManager.GenerateToken();
            bool   newVerificationTokenWasAssigned = false;

            if (newToken != "")
            {
                AccountVerificationServiceClient accountVerificationServiceClient =
                    new AccountVerificationServiceClient();
                newVerificationTokenWasAssigned = accountVerificationServiceClient.AssignNewRecoveryToken(_emailAddress, newToken);
            }

            if (newVerificationTokenWasAssigned)
            {
                TokenInfoDto verificationTokenInfo = new TokenInfoDto()
                {
                    Name         = _username,
                    EmailAddress = _emailAddress,
                    Token        = newToken
                };
                TokenManager.SendToken(verificationTokenInfo);
                MessageBox.Show(Properties.Langs.Resources.NewCodeSentMessage);
            }
        }