mittwald / mittwald/api-client-js
withAccessToken: allow dynamic tokens
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 0
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
https://github.com/mittwald/api-client-js/pull/45 introduced the common interceptor withAccessToken.
If changing the access-token at runtime should be supported (what I suppose is a real-world-use-case), the withAccessToken interceptor is not the right solution, because it would require to create a new client and replace all usages.
Maybe the token parameter could be a function (executed in the interceptor) or a variable bag { token: string } what can be mutated during runtime – but this is a not so common and reasonable approach.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The common interceptor withAccessToken was introduced by PR #45; start there and trace when its token parameter is read. Define and verify a runtime token-change path that does not require recreating the client or replacing existing usages, then cover the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100