@@ -52,39 +52,39 @@ class api {
52
52
req = { url : req } ;
53
53
}
54
54
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 ) ;
56
56
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 ) ) ;
58
58
}
59
59
60
60
post ( req , good , bad ) {
61
61
if ( typeof req === 'string' ) {
62
62
req = { url : req } ;
63
63
}
64
64
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 ) ;
66
66
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 ) ) ;
68
68
}
69
69
70
70
put ( req , good , bad ) {
71
71
if ( typeof req === 'string' ) {
72
72
req = { url : req } ;
73
73
}
74
74
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 ) ;
76
76
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 ) ) ;
78
78
}
79
79
80
80
del ( req , good , bad ) {
81
81
if ( typeof req === 'string' ) {
82
82
req = { url : req } ;
83
83
}
84
84
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 ) ;
86
86
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 ) ) ;
88
88
}
89
89
}
90
90
0 commit comments