Added isUserAuthenticated() function.