Hide the search bar unless a user is logged in

It feels really gross to inject jQuery script here, but I can't figure out where else we have access to the session status and the blacklight partials in TDIL.  Totally hoping for a more elegant solution.