if (!window.logged_in) {
  $('#save-current-search, #pre-saved-reports').click(function() {
    window.location.replace('/members/login')
  })
}

// it should be added to the layouts / content before just before </body>
// <r:logged_in/>
// <script src="/javascripts/auth.js" type="text/javascript"></script>