From b8e1874cd93a0ab0de73e5d0a86661264513ec6d Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Tue, 17 Mar 2020 11:22:42 -0600 Subject: [PATCH] Task List: verify Stripe key patterns before continuing. (https://github.com/woocommerce/woocommerce-admin/pull/3910) --- .../client/dashboard/task-list/tasks/payments/stripe.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/stripe.js b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/stripe.js index 1adeb60a7cc..26b6cc39fb1 100644 --- a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/stripe.js +++ b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/stripe.js @@ -298,15 +298,15 @@ class Stripe extends Component { validateManualConfig( values ) { const errors = {}; - if ( ! values.publishable_key ) { + if ( values.publishable_key.match( /^pk_live_/ ) === null ) { errors.publishable_key = __( - 'Please enter your publishable key', + 'Please enter a valid publishable key. Valid keys start with "pk_live".', 'woocommerce-admin' ); } - if ( ! values.secret_key ) { + if ( values.secret_key.match( /^[rs]k_live_/ ) === null ) { errors.secret_key = __( - 'Please enter your secret key', + 'Please enter a valid secret key. Valid keys start with "sk_live" or "rk_live".', 'woocommerce-admin' ); }