When users attempt to access a page which requires a login, the homepage adds a message which states "To view this link you need to be an eligible library user. Please login to continue." This is helpful when the user clicked a link which is going to take them somewhere inside the library.
The blank search query link https://wikipedialibrary.wmflabs.org/search/?q= redirects users to the homepage, because it's not a valid search URL. In this case, the message doesn't make as much sense. We should not display the message when users have come via this route.