Ejemplo n.º 1
0
 public Employee AuthenticateUser(string email, string password)
 {
     Employee result;
     var passwordHash = HashPassword(password);
     try
     {
         result = _userAccessor.AuthenticateUser(email, passwordHash);
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Login failed", ex);
     }
     return result;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creator : Zach Behrensmeyer
        /// Created: 2/3/2020
        /// Approver: Steven Cardona
        ///
        /// This calls the User Authentication Data Accessor Method
        /// </summary>
        /// <remarks>
        /// Updater: NA
        /// Updated: NA
        /// Update: NA
        ///
        /// </remarks>
        /// <param name="email"></param>
        /// <param name="password"></param>
        /// <returns>Returns Valid User Info</returns>
        public PetUniverseUser AuthenticateUser(string email, string password)
        {
            PetUniverseUser result       = null;
            var             passwordHash = hashPassword(password);

            password = null;

            try
            {
                result = _userAccessor.AuthenticateUser(email, passwordHash);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Login failed!", ex);
            }
            return(result);
        }
        public User AuthenticateUser(string email, string password)
        {
            User user = null;

            try
            {
                var passwordHash = hashPassword(password);
                password = null;

                user = _userAccessor.AuthenticateUser(email, passwordHash);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Bad email address or password.", ex);
            }
            return(user);
        }