I created a little template to handle this. It assumes a NetWebServerWorker called p_web is present, I usually pass this into the procedure anyway, it's not perfect but works, feel free to use/modify as you like.
#TEMPLATE(MyTemplate,'My Templates'),FAMILY('ABC')
#EXTENSION(ReportLoginRequired,'Require Login for Nettalk Reports')
#AT(%AdditionalDebugHooks),PRIORITY(1000)
If p_web.GetSessionLoggedIn() = 0
p_web.SendError (401,'Unauthorized', 'A login is required to view this page')
Return
End
#ENDAT