mittwald / mittwald/api-client-js

withAccessToken: allow dynamic tokens

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.