Beispiel #1
0
        public async Task <IdentityResult> ConfirmEmail(string userId, string token)
        {
            var user = await _identityProvider.GetById(userId);

            if (user == default(User))
            {
                return(new IdentityResult
                {
                    Succeeded = false
                });
            }

            if (await _identityManager.IsEmailConfirmed(user.UserName))
            {
                return(new IdentityResult
                {
                    Succeeded = false
                });
            }

            return(await _identityManager.ConfirmEmailToken(user.UserName, token));
        }