示例#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);
            }
        }