As @sdpiowa suggests, you’re asking the wrong question.
What you want is for Discourse to authenticate against whatever knows who your customers are so that only those people can log in. Then all you have to do is make login_required
.
If it’s WordPress, then WP Discourse plugin installation and setup is where to start. If it’s something else, then you’ll have to do something else.