-
Notifications
You must be signed in to change notification settings - Fork 238
Closed
Labels
Description
Good afternoon,
when I want to delete the token in the following way
this.$axios.setToken(false, 'Bearer', [ 'get', 'post', 'delete', 'put', 'patch', ])
I noticed that it was not being completely deleted, and after a little digging I came to the conclusion that the setHeader function is returning before going through all the scope.
Lines 10 to 18 in a9e4867
| setHeader (name, value, scopes = 'common') { | |
| for (const scope of Array.isArray(scopes) ? scopes : [ scopes ]) { | |
| if (!value) { | |
| delete this.defaults.headers[scope][name]; | |
| return | |
| } | |
| this.defaults.headers[scope][name] = value | |
| } | |
| }, |
I propose to change that return for a continue, because otherwise only the first element of the scope is deleted.
Greetings.
pi0LenaCM