Beispiel #1
0
        //AUTHENTICATE
        public static bool Authenticate(string username, string password, bool?rememberMe)
        {
            if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
            {
                string            passwordHash = Password.GenerateHash(username, password);
                AuthenticatedUser user         = AuthenticatedUser.FindUser(username, passwordHash);
                if (user != null)
                {
                    SetCredentials(user, rememberMe ?? false);

                    return(true);
                }
            }

            return(false);
        }