Skip to content
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: trigger a callback function provided by client when a token expires #907

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dudunog
Copy link
Contributor

@dudunog dudunog commented Mar 29, 2024

Description of changes

  • Implement a mechanism to trigger a user-provided callback function when an access token expires. This allows the client to handle token expiration events in a custom manner, such as refreshing the token.

GitHub issues resolved by this PR

Quality Assurance

  • Once the changes in this PR are merged and deployed, success criteria is: trigger a callback function provided by client when a token expires.

More info

@cla-bot cla-bot bot added the cla-signed label Mar 29, 2024
@dudunog dudunog changed the title feat: trigger a callback function provided by client when a token exp… feat: trigger a callback function provided by client when a token expires Mar 29, 2024
@jfoliveira jfoliveira requested a review from Silva97 March 29, 2024 23:24
@dudunog dudunog requested a review from jfoliveira April 7, 2024 14:13
@dudunog dudunog requested a review from jfoliveira April 9, 2024 00:25
Comment on lines +133 to +135
if (callback) {
ApiBaseService.onTokenExpired = callback;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dudunog why use a conditional block here? callback is non-optional by the types on the function declaration above.

Suggested change
if (callback) {
ApiBaseService.onTokenExpired = callback;
}
ApiBaseService.onTokenExpired = callback;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define onTokenExpired event
3 participants