File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 0.30.6 " ,
2
+ "version" : " 0.30.7 " ,
3
3
"license" : " MIT" ,
4
4
"main" : " dist/index.js" ,
5
5
"typings" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -106,9 +106,16 @@ export class Messages {
106
106
formData . append ( 'map' , JSON . stringify ( { '0' : [ 'variables.input.files' ] } ) ) ;
107
107
formData . append ( '0' , file , file . name ) ;
108
108
109
- // The Authorization header should be added by the interceptor
110
- // that was set up in the constructor
111
- const response = await this . axiosClient . post ( '' , formData ) ;
109
+ // Get the auth token from localStorage
110
+ const authToken = localStorage . getItem ( "token" ) || null ;
111
+
112
+ // Use inline config with Content-Type and Authorization if available
113
+ const response = await this . axiosClient . post ( '' , formData , {
114
+ headers : {
115
+ 'Content-Type' : 'multipart/form-data' ,
116
+ ...( authToken && { 'Authorization' : `Bearer ${ authToken } ` } )
117
+ } ,
118
+ } ) ;
112
119
113
120
return response ;
114
121
}
You can’t perform that action at this time.
0 commit comments