File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,27 @@ class FlexTokenGenerator extends TwilioClientCommand {
1515 async run ( ) {
1616 await super . run ( ) ;
1717
18+ const workerSid = await this . flags [ 'worker-sid' ] ;
19+ const workspaceSid = await this . flags [ 'workspace-sid' ] ;
1820 const accessToken = createToken . call ( this ) ;
1921
20- if ( ! validateWorkerSid ( this . flags [ 'worker-sid' ] ) ) {
22+ if ( ! validateWorkerSid ( workerSid ) ) {
2123 this . logger . error (
2224 'Invalid Worker SID, must look like WKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
2325 ) ;
2426 process . exit ( 1 ) ;
2527 }
2628
27- if ( ! validateWorkspaceSid ( this . flags [ 'workspace-sid' ] ) ) {
29+ if ( ! validateWorkspaceSid ( workspaceSid ) ) {
2830 this . logger . error (
2931 'Invalid Workspace SID, must look like WSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
3032 ) ;
3133 process . exit ( 1 ) ;
3234 }
3335
3436 let flexGrant = new Twilio . jwt . AccessToken . TaskRouterGrant ( {
35- workerSid : this . flags [ 'worker-sid' ] ,
36- workspaceSid : this . flags [ 'workspace-sid' ] ,
37+ workerSid,
38+ workspaceSid,
3739 role : 'worker'
3840 } ) ;
3941 accessToken . addGrant ( flexGrant ) ;
You can’t perform that action at this time.
0 commit comments