File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -11,27 +11,28 @@ class SyncTokenGenerator extends TwilioClientCommand {
1111 this . showHeaders = true ;
1212 }
1313
14- validateSyncServiceSid ( ) {
14+ validateSyncServiceSid ( sid ) {
1515 return (
16- this . flags [ 'sync-service- sid' ] . startsWith ( 'IS' ) &&
17- this . flags [ 'sync-service- sid' ] . length === 34
16+ sid . startsWith ( 'IS' ) &&
17+ sid . length === 34
1818 ) ;
1919 }
2020
2121 async run ( ) {
2222 await super . run ( ) ;
2323
24+ const syncServiceSid = await this . flags [ 'sync-service-sid' ] ;
2425 const accessToken = createToken . call ( this ) ;
2526
26- if ( ! this . validateSyncServiceSid ( ) ) {
27+ if ( ! this . validateSyncServiceSid ( syncServiceSid ) ) {
2728 this . logger . error (
2829 'Invalid Sync Service SID, must look like ISxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
2930 ) ;
3031 process . exit ( 1 ) ;
3132 }
3233
3334 let syncGrant = new Twilio . jwt . AccessToken . SyncGrant ( {
34- serviceSid : this . flags [ 'sync-service-sid' ] ,
35+ serviceSid : syncServiceSid
3536 } ) ;
3637 accessToken . addGrant ( syncGrant ) ;
3738
You can’t perform that action at this time.
0 commit comments