Skip to content

Conversation

@maliming
Copy link
Member

@maliming maliming commented Jan 2, 2026

Resolve #24468

Copilot AI review requested due to automatic review settings January 2, 2026 08:04
@maliming maliming added this to the 10.2-preview milestone Jan 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors token validation in the CookieAuthenticationOptionsExtensions to improve maintainability, fix logic errors, and consolidate duplicate code. The changes resolve issue #24468 by fixing the token expiration check logic and improving the handling of introspection endpoints.

Key Changes:

  • Fixed token expiration check logic to properly validate tokens expiring within the advance window (changed from checking expired tokens to checking soon-to-expire tokens)
  • Added support for chaining multiple OnValidatePrincipal handlers by preserving and invoking the previous handler
  • Consolidated duplicate code by marking IntrospectAccessToken as obsolete and delegating to CheckTokenExpiration

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/DependencyInjection/CookieAuthenticationOptionsExtensions.cs Core refactoring with bug fixes: corrected token expiration logic, improved introspection endpoint handling with fallback logic, enhanced logging messages with structured parameters, fixed async method modifiers, and added previousHandler chaining support
framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs Simplified by removing duplicate implementation and delegating to the main CheckTokenExpiration method, marked old method as obsolete

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maliming maliming requested a review from EngincanV January 2, 2026 08:22
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.

Standardize CheckTokenExpiration and IntrospectAccessToken methods.

2 participants