Repository navigation
Auto-merge forward rel-10.7 → rel-11.0 - #26369
Merged
Merged
Conversation
…storage Fix multi-tab sign-out in `@abp/ng.oauth`
…d/rel-10.7-to-rel-11.0-120
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Queued sign-ins can lose explicit parameters or hang indefinitely after discovery failure, while cross-tab token replacement can leave user and permission state incorrectly anonymous.
3 open issues
What changed in this PR
Forward-merges Angular authentication improvements from rel-10.7 into rel-11.0, covering OAuth token sharing, sign-in recovery, and application configuration refreshes.
Changes:
- Coordinates token loading across tabs and preserves tokens after transient refresh failures.
- Shares default sign-in redirects and adds optional sign-in on tokenless 401 responses.
- Prevents stale configuration updates and adds regression tests and documentation.
| File | Description |
|---|---|
npm/ng-packs/packages/theme-shared/src/lib/tests/authentication-error-handler.spec.ts |
Tests 401 recovery and return URLs. |
npm/ng-packs/packages/theme-shared/src/lib/services/authentication-error-handler.service.ts |
Handles expired tokens and guards against stale logout decisions. |
npm/ng-packs/packages/theme-shared/src/lib/models/common.ts |
Adds the signInWithoutToken option. |
npm/ng-packs/packages/oauth/src/lib/utils/sign-in-callback.ts |
Detects OAuth sign-in callbacks. |
npm/ng-packs/packages/oauth/src/lib/utils/check-access-token.ts |
Protects expired and newly shared tokens. |
npm/ng-packs/packages/oauth/src/lib/utils/auth-utils.ts |
Identifies transient token-request failures. |
npm/ng-packs/packages/oauth/src/lib/tests/oauth.service.spec.ts |
Tests initialization and queued sign-ins. |
npm/ng-packs/packages/oauth/src/lib/tests/multi-tab-tokens.spec.ts |
Tests token synchronization across tabs. |
npm/ng-packs/packages/oauth/src/lib/tests/memory-token-storage.service.spec.ts |
Tests storage readiness, broadcasts, and reload handling. |
npm/ng-packs/packages/oauth/src/lib/tests/initial-utils.spec.ts |
Updates the token-expiration mock. |
npm/ng-packs/packages/oauth/src/lib/tests/check-access-token.spec.ts |
Tests token-retention decisions. |
npm/ng-packs/packages/oauth/src/lib/tests/auth-code-flow-strategy.spec.ts |
Tests redirects, callbacks, and refresh failures. |
npm/ng-packs/packages/oauth/src/lib/strategies/auth-password-flow-strategy.ts |
Preserves shared tokens and handles transient failures. |
npm/ng-packs/packages/oauth/src/lib/strategies/auth-flow-strategy.ts |
Coordinates refresh-error recovery and token cleanup. |
npm/ng-packs/packages/oauth/src/lib/strategies/auth-code-flow-strategy.ts |
Shares redirects and protects pending callbacks. |
npm/ng-packs/packages/oauth/src/lib/services/oauth.service.ts |
Waits for token storage and queues early sign-ins. |
npm/ng-packs/packages/oauth/src/lib/services/memory-token-storage.service.ts |
Adds startup snapshots and batched token writes. |
npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts |
Tests cancellation of stale configuration updates. |
npm/ng-packs/packages/core/src/lib/services/config-state.service.ts |
Cancels superseded localization requests. |
docs/en/framework/ui/angular/oauth-module.md |
Documents token storage and sign-in recovery. |
docs/en/framework/ui/angular/http-error-handling.md |
Documents tokenless 401 sign-in configuration. |
Review effort: Balanced
| return; | ||
| } | ||
|
|
||
| toStart.forEach(login => this.startLogin(login.queryParams)); |
Comment on lines
+272
to
+275
| if (oAuthService.loginUrl === '') { | ||
| await firstValueFrom( | ||
| oAuthService.events.pipe(filter(event => event.type === 'discovery_document_loaded')), | ||
| ); |
Comment on lines
+34
to
+37
| const isAnonymous = ({ currentUser }: ApplicationConfigurationDto) => | ||
| !currentUser.isAuthenticated && this.authService.getAccessToken() === accessToken; | ||
|
|
||
| let anonymous$ = this.configStateService.refreshAppState().pipe(filter(isAnonymous)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Automated forward merge of
rel-10.7intorel-11.0.