🦺 Losen the validation rules for Client ID

This commit is contained in:
Philipp Stracker 2025-02-10 16:27:52 +01:00
parent aca02dcb90
commit 9037fa9b7d
No known key found for this signature in database
3 changed files with 2 additions and 3 deletions

View file

@ -96,7 +96,7 @@ const ManualConnectionForm = () => {
// On-the-fly form validation. // On-the-fly form validation.
useEffect( () => { useEffect( () => {
setClientValid( setClientValid(
! manualClientId || /^A[\w-]{79}$/.test( manualClientId ) ! manualClientId || /^[\w-]{80,}$/.test( manualClientId )
); );
setSecretValid( manualClientSecret && manualClientSecret.length > 0 ); setSecretValid( manualClientSecret && manualClientSecret.length > 0 );
}, [ manualClientId, manualClientSecret ] ); }, [ manualClientId, manualClientSecret ] );

View file

@ -88,7 +88,6 @@ class AuthenticationRestEndpoint extends RestEndpoint {
'type' => 'string', 'type' => 'string',
'sanitize_callback' => 'sanitize_text_field', 'sanitize_callback' => 'sanitize_text_field',
'minLength' => 80, 'minLength' => 80,
'maxLength' => 80,
), ),
'clientSecret' => array( 'clientSecret' => array(
'required' => true, 'required' => true,

View file

@ -147,7 +147,7 @@ class AuthenticationManager {
throw new RuntimeException( 'No client ID provided.' ); 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.' ); throw new RuntimeException( 'Invalid client ID provided.' );
} }