equinor / equinor/fusion-framework
module-http: handle acquireAccessToken failures in the default MSAL request handler
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 10
- Avg merge
- 19h 40m
- Merged PRs (30d)
- 150
Description
In `packages/modules/http/src/module.ts`, the MSAL default HTTP request handler calls `authProvider.acquireAccessToken(...)` without a try/catch:
```ts
const accessToken = await authProvider.acquireAccessToken({
request: { scopes },
});
```
If token acquisition throws (e.g. interaction required, network failure), the error currently propagates uncaught out of the request handler. We should wrap this in a try/catch and decide how callers should be notified/handled (e.g. rethrow a typed error, emit a warning and continue without the header, etc.).
Contributor guide
Research direction
Start in packages/modules/http/src/module.ts by reading the default MSAL HTTP request handler and tracing how its callers receive authentication failures. Decide and document the intended behavior for acquireAccessToken errors, then verify that the chosen handling is covered by relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100