Updated WEBHOOK_SECRET check to output a warning

refs https://github.com/TryGhost/Team/issues/841

When using our development tooling Ghost should always start, instead of
exiting with an error. This check for the WEBHOOK_SECRET env var was the
primary cause of Ghost erroring in development, so it's been switched
with a warning.
This commit is contained in:
Fabien O'Carroll 2021-07-12 10:48:52 +01:00 committed by Fabien 'egg' O'Carroll
parent 65111c9464
commit caf01544c8

View File

@ -68,7 +68,8 @@ const membersService = {
if (env !== 'production') {
if (!process.env.WEBHOOK_SECRET && membersConfig.isStripeConnected()) {
throw new Error('Cannot use remote webhooks in development. Please restart in production mode or see https://ghost.org/docs/webhooks/#stripe-webhooks for developing with Stripe.');
process.env.WEBHOOK_SECRET = 'DEFAULT_WEBHOOK_SECRET';
logging.warn('Cannot use remote webhooks in development. See https://ghost.org/docs/webhooks/#stripe-webhooks for developing with Stripe.');
}
if (paymentConfig && paymentConfig.secretKey.startsWith('sk_live')) {