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

Emit a TokenRefreshFailedEvent when the automatic token refresh fails #153

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

Conversation

rokabakaroni
Copy link

Description

As in #120, I added the emission of a OidcTokenRefreshFailedEvent when the handleTokenExpiring handler fails.

The refreshToken code was repeated inside the handler, so I substituted most of the code with a call to it (maybe I should have created a _refreshToken method to not expose the new overrideToken optional parameter to the refreshToken method?).

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@rokabakaroni rokabakaroni force-pushed the token-refresh-failed-event branch from dfebb51 to 9b2b56f Compare December 8, 2024 17:19
@@ -731,10 +731,12 @@ abstract class OidcUserManagerBase {
///
/// An [OidcException] will be thrown if the server returns an error.
Future<OidcUser?> refreshToken({
OidcToken? overrideToken,
Copy link
Member

Choose a reason for hiding this comment

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

I think the overrideToken is unnecessary here, as you said, shared code should go into a doRefreshToken method that's marked @protected

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestions, should be done.

@rokabakaroni rokabakaroni force-pushed the token-refresh-failed-event branch from 6674e7e to f2f425d Compare December 9, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants