-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add refreshTokenHandler option #7237
base: main
Are you sure you want to change the base?
Conversation
π¦ Changeset detectedLatest commit: 6810360 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments qdded
[ADDED] new option to the `middlewareModule` - `refreshTokenHandler`. | ||
This special handler can be used to handle 401 errors and refresh the token. | ||
It is called before the generic `errorHandler`. | ||
By default, it thrown an error which is being caught by the `errorHandler` and rethrown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that some small diagram (even ascii) with the sequence will be useful here. Or maybe we can somehow rephrase this sentence, I think I would not understand it without my knowledge about how it works. Something like an explanation that by default we are not able to predict the mechanism of token refresh because of differences in different services therefore we do not provide any default behavior, we simply push the error to the errorHandler without any further actions.
methodName, | ||
url, | ||
params, | ||
config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a module config? Or what kind of config? Will I have some docs in TS? If not maybe lets explain the injected object here?
Converted to draft as I'm still not convinced that it is the best solution. |
Quality Gate passedIssues Measures |
π Linked issue
β Type of change
π Description
Adds a new optional property
refreshTokenHandler
to themiddlewareModule
π Checklist