@@ -52,39 +52,39 @@ class api {
5252 req = { url : req } ;
5353 }
5454
55- const thisReq = api . __buildRequestObj ( requester . get ( this . baseUrl + req . url ) , req ) ;
55+ const thisReq = api . __buildRequestObj ( requester . get ( this . baseUrl + req . url ) . withCredentials ( ) , req ) ;
5656
57- thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
57+ return thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
5858 }
5959
6060 post ( req , good , bad ) {
6161 if ( typeof req === 'string' ) {
6262 req = { url : req } ;
6363 }
6464
65- const thisReq = api . __buildRequestObj ( requester . post ( this . baseUrl + req . url ) , req ) ;
65+ const thisReq = api . __buildRequestObj ( requester . post ( this . baseUrl + req . url ) . withCredentials ( ) , req ) ;
6666
67- thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
67+ return thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
6868 }
6969
7070 put ( req , good , bad ) {
7171 if ( typeof req === 'string' ) {
7272 req = { url : req } ;
7373 }
7474
75- const thisReq = api . __buildRequestObj ( requester . put ( this . baseUrl + req . url ) , req ) ;
75+ const thisReq = api . __buildRequestObj ( requester . put ( this . baseUrl + req . url ) . withCredentials ( ) , req ) ;
7676
77- thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
77+ return thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
7878 }
7979
8080 del ( req , good , bad ) {
8181 if ( typeof req === 'string' ) {
8282 req = { url : req } ;
8383 }
8484
85- const thisReq = api . __buildRequestObj ( requester . del ( this . baseUrl + req . url ) , req ) ;
85+ const thisReq = api . __buildRequestObj ( requester . del ( this . baseUrl + req . url ) . withCredentials ( ) , req ) ;
8686
87- thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
87+ return thisReq . then ( ( res ) => api . __buildResponseWrapper ( res , good ) , ( err ) => bad ( err , err . response . body ) ) ;
8888 }
8989}
9090
0 commit comments