-
Notifications
You must be signed in to change notification settings - Fork 961
Conversation
I see what you are trying to do (and what you are trying to solve), but I'm not sure if I like this approach. I need to think a little bit about this one... |
@svanharmelen there could be an alternative solution: we may add to Either way it's a nice feature to have: switching between tokens is a little bit painful now. |
@svanharmelen any update? |
Sorry for the delay... But I think I prefer to use a new option like you suggested ( |
@svanharmelen you will merge this code or I need write some update? |
Sorry for the bad response, been busy and been ill. I'll try to have another look coming week. |
Please check the commit I just added, this is more what I was thinking about. This would still solve your use case, right? |
@svanharmelen we have problem with your code.
I can't use private type and const for this method. And code |
And this solution not well as use context. For example I have one func who call some GitLab API.
In all func, when I use call api I need send context + reqOpts or token. |
Good point about the fact that But I don't understand your other comment. What is the problem there? |
Updated the code to export the Your comment is about the fact that you now have to send both the context and the token or request options, instead of only the context right? I understand, but I don't want to rely on the context as there are also projects that do not use a context when making API calls. In your case you can still use your own context and put the token in there to send it around. And then in the function where you make the API call you can extract it from your context and put it into the request options. |
Can we stile both variant?
but need to prioritize this methods. |
I don't prefer to add both variants, sorry. I personally wouldn't even have added the Yet I don't want to make things harder as they need to be, so adding |
Ok. It's good for me, thx. Waiting for new release ) |
Fix #1210
For use user token we need change token