Example #1
0
        public bool ConfirmUserToken(string email, string token)
        {
            var user = repository.FindUserByEmailincludeToken(email);

            if (user == null)
            {
                return(false);
            }
            if (user.IsEmailConfirmed)
            {
                return(true);
            }
            var res = user.ConfirmUser(token);

            roleService.AddUserDefualtRole(user);
            if (res)
            {
                unitOfWork.Commit();
            }
            return(res);
        }