How to make uploads available only to logged-in users

I don’t think that does what you think it does.

What are you trying to do, exactly?

Do you want Discourse to be protected by BASIC auth before a user can see it?