Thanks Hannah, the config is exactly what I was trying to find. There’s a problem though:
For self-hosted Ghost users, a custom configuration file can be used to override Ghost’s default behaviour. This provides you with a range of options to configure your publication to suit your needs.
I’m not self-hosting Ghost; we’ve already paid for hosting from ghost.org. So this isn’t really an option, unless it’s possible to edit the configuration for ghost.org sites. But I don’t see that article mention this.
Yes, I was thinking it may be a bit of a pain to have to regularly update my forked @tryghost/portal
code. However, I don’t expect to make a tonne of changes, so I imagine it’d be pretty straightforward to perform merges and I’d only have to do this every now and then.
The advantage to this approach is I’ll be able to easily make front-end changes for the portal, instead of being restricted to back-end changes with the webhooks.
There are some cases where I can see only having a back-end solution being an issue. For example, what if the blocked user signs up straight away with a premium tier, and has already paid for it with their card.
That means I’d have to programatically refund them in the webhook script, or alternatively, manually refund them later. This isn’t ideal–I want to prevent them from being able to make a payment in the first place.
Of course, another solution would be to block their email address on Stripe’s end too, so once they enter the Stripe checkout, they can’t proceed. But AFAIK that’s not possible, because the only way I’ve seen Stripe lets you block users, is to mark certain users as fraudulent (but this isn’t technically true, we’re not blocking them from fraudulent activity, but for other reasons). So I don’t think that solution would be appropriate.
Therefore because of the above logic, I thought it’s probably going to be best to just fork your @tryghost/portal
code and have a front-end blocking feature, which will prevent them from being able to sign up at all (instead of the webhooks, which block/remove them after they’ve already signed up as a free/paid member).
But let me know if you have any better ideas. Thanks.