Example #1
0
        public void ForgetPass(string userId)
        {
            var profile = _dbSet.AsNoTracking().SingleOrDefault(x => x.Id == userId);

            if (profile != null)
            {
                Guid code = Guid.NewGuid();
                uow.Token.AddToken(new Token()
                {
                    Id          = code,
                    UserId      = userId,
                    CreatedDate = DateTime.Now
                });
                EmailUtils emailsvc = new EmailUtils(new Entities.Integration.Gmail.EmailToModel()
                {
                    Email     = profile.Email,
                    FullName  = profile.FullName,
                    AvatarUrl = profile.Avatar
                });
                string url = $"{ROOT_URL}/#!/auth/newpassword/?u={userId}&c={code}";
                emailsvc.SendResetPassword(url);
            }
        }