One way to accomplish this would be to send requests to restricted content through the loginTest method first. With redirect parameters, you can use success_redirect to point to the restricted page if the loginTest returns that the user is logged in. You could then use error_redirect to send the user to a login page if they aren't logged in.