/// <summary> /// This ,ethod is used to authenticate a users login /// </summary> /// <param name="email"></param> /// <param name="password"></param> /// <returns></returns> public AppUser AuthenticateAppUserLogin(string email, string password) { var hashPassword = new Md5Ecryption().ConvertStringToMd5Hash(password.Trim()); var user = new AppUserFactory().GetAppUserByLogin(email, hashPassword); return(user); }
/// <summary> /// This method is used to send a forgot password request to fetch the user /// </summary> /// <param name="email"></param> /// <returns></returns> public AppUser ForgotPasswordRequest(string email) { email = email.Trim(); var user = new AppUserFactory().GetAppUserByEmail(email); var appuser = _db.AppUsers.Find(user.AppUserId); var newPassword = Membership.GeneratePassword(8, 1); appuser.Password = newPassword; _db.Entry(appuser).State = EntityState.Modified; _db.SaveChanges(); new MailerDaemon().ResetUserPassword(appuser); return(user); }