mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🦺 Losen the validation rules for Client ID
This commit is contained in:
parent
aca02dcb90
commit
9037fa9b7d
3 changed files with 2 additions and 3 deletions
|
@ -96,7 +96,7 @@ const ManualConnectionForm = () => {
|
|||
// On-the-fly form validation.
|
||||
useEffect( () => {
|
||||
setClientValid(
|
||||
! manualClientId || /^A[\w-]{79}$/.test( manualClientId )
|
||||
! manualClientId || /^[\w-]{80,}$/.test( manualClientId )
|
||||
);
|
||||
setSecretValid( manualClientSecret && manualClientSecret.length > 0 );
|
||||
}, [ manualClientId, manualClientSecret ] );
|
||||
|
|
|
@ -88,7 +88,6 @@ class AuthenticationRestEndpoint extends RestEndpoint {
|
|||
'type' => 'string',
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
'minLength' => 80,
|
||||
'maxLength' => 80,
|
||||
),
|
||||
'clientSecret' => array(
|
||||
'required' => true,
|
||||
|
|
|
@ -147,7 +147,7 @@ class AuthenticationManager {
|
|||
throw new RuntimeException( 'No client ID provided.' );
|
||||
}
|
||||
|
||||
if ( false === preg_match( '/^A[\w-]{79}$/', $client_secret ) ) {
|
||||
if ( false === preg_match( '/^[\w-]{80,}$/', $client_secret ) ) {
|
||||
throw new RuntimeException( 'Invalid client ID provided.' );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue