@@ -49,10 +49,10 @@ function (user, context, callback) {
4949 }
5050
5151 global . M2MToken = body . access_token ;
52- console . log ( 'rule:onboarding-checklist:setting the M2MToken globally' ) ;
52+ console . log ( 'rule:onboarding-checklist:setting the M2MToken globally' , global . M2MToken ) ;
5353 return callback ( null , global . M2MToken ) ;
5454 } ) ;
55- }
55+ } ;
5656
5757 getToken ( function ( err , token ) {
5858 if ( err ) {
@@ -72,15 +72,15 @@ function (user, context, callback) {
7272 headers : {
7373 Authorization : `Bearer ${ token } `
7474 }
75- }
75+ } ;
7676
7777 axios ( options ) . then ( result => {
7878 const data = result . data ;
7979
8080 if ( data . length === 0 ) {
8181 context . redirect = {
8282 url : redirectUrl
83- }
83+ } ;
8484 console . log ( 'rule:onboarding-checklist:Setting redirectUrl' , redirectUrl ) ;
8585 return callback ( null , user , context ) ;
8686 }
@@ -89,8 +89,8 @@ function (user, context, callback) {
8989
9090 for ( let checklistTrait of onboardingChecklistTrait . data ) {
9191 if (
92- checklistTrait . onboarding_wizard != null &&
93- ( checklistTrait . onboarding_wizard . status != null ||
92+ checklistTrait . onboarding_wizard !== null &&
93+ ( checklistTrait . onboarding_wizard . status !== null ||
9494 checklistTrait . onboarding_wizard . skip )
9595 ) {
9696 return callback ( null , user , context ) ;
@@ -113,19 +113,19 @@ function (user, context, callback) {
113113
114114 context . redirect = {
115115 url : redirectUrl
116- }
116+ } ;
117117 console . log ( 'rule:onboarding-checklist:Setting redirectUrl' , redirectUrl ) ;
118118 return callback ( null , user , context ) ;
119119 } ) . catch ( requestError => {
120- console . log ( "rule:onboarding-checklist:Failed fetching onboarding_checklist with error" , requestError ) ;
120+ console . log ( "rule:onboarding-checklist:Failed fetching onboarding_checklist with error" , requestError . response . status ) ;
121121 return callback ( null , user , context ) ;
122- } )
122+ } ) ;
123123
124124 } catch ( e ) {
125125 console . log ( "rule:onboarding-checklist:Error in fetching onboarding_checklist" , + e ) ;
126126 return callback ( null , user , context ) ;
127127 }
128- } )
128+ } ) ;
129129 } else {
130130 return callback ( null , user , context ) ;
131131 }
0 commit comments