samus14 we have an existing issue for this here flarum/core654
We do plan to implement that, but it requires to first refactor the app so that 404 pages get answered by the single page app.
In the meantime a workaround would be to edit the text of the 404 page through the Linguist extension to suggest logging in to users. But there's no easy way to insert a login link.
The consensus in the issue above appears to be that we don't want to disclose whether the page exists or not, and just want to suggest logging in on any 404 page. To show a special page only on discussions that exist but require authentication, a custom extension would have to be created.