[Blazor] Remove obsolete APIs from Components - #19
Conversation
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Greptile SummaryThis PR removes obsolete APIs from the Blazor Components area, including deprecated authentication methods, event callback extensions, and configuration classes. Critical Issue Found:
Key Changes:
Confidence Score: 0/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant App
participant RemoteAuthenticatorViewCore
participant NavigationManager
participant AuthenticationService
Note over RemoteAuthenticatorViewCore: PR removes obsolete APIs<br/>and SignOutSessionStateManager
User->>App: Click Sign Out
App->>RemoteAuthenticatorViewCore: ProcessLogOut(returnUrl)
alt HistoryEntryState is null
RemoteAuthenticatorViewCore->>RemoteAuthenticatorViewCore: ValidateSignOutRequestState()
RemoteAuthenticatorViewCore->>RemoteAuthenticatorViewCore: GetCachedNavigationState() returns null
Note right of RemoteAuthenticatorViewCore: BUG: Returns false,<br/>rejects valid sign-out
RemoteAuthenticatorViewCore->>NavigationManager: NavigateTo(LogOutFailedPath)
NavigationManager-->>User: Show "logout was not initiated from within the page"
else HistoryEntryState exists
RemoteAuthenticatorViewCore->>RemoteAuthenticatorViewCore: ValidateSignOutRequestState()
RemoteAuthenticatorViewCore->>RemoteAuthenticatorViewCore: Check Interaction == SignOut
alt Valid sign-out
RemoteAuthenticatorViewCore->>AuthenticationService: SignOutAsync()
AuthenticationService-->>RemoteAuthenticatorViewCore: Success
RemoteAuthenticatorViewCore->>NavigationManager: NavigateTo(returnUrl)
NavigationManager-->>User: Signed out successfully
else Invalid sign-out
RemoteAuthenticatorViewCore->>NavigationManager: NavigateTo(LogOutFailedPath)
NavigationManager-->>User: Sign-out failed
end
end
|
| if ((Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) || | ||
| // For backcompat purposes, keep SignOutManager working, even though we now use the history.state for this. | ||
| (Navigation.HistoryEntryState == null && !await SignOutManager.ValidateSignOutState())) | ||
| if (!ValidateSignOutRequestState()) |
There was a problem hiding this comment.
logic: sign-out validation fails when HistoryEntryState is null
ValidateSignOutRequestState() returns false when Navigation.HistoryEntryState is null (since GetCachedNavigationState() returns null in that case). This breaks sign-out for users without history state, rejecting legitimate sign-out requests.
The fix from commit 1fba0ca was correct: if (Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) - only validate when history state exists.
| if (!ValidateSignOutRequestState()) | |
| if (Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs
Line: 281:281
Comment:
**logic:** sign-out validation fails when `HistoryEntryState` is null
`ValidateSignOutRequestState()` returns `false` when `Navigation.HistoryEntryState` is null (since `GetCachedNavigationState()` returns `null` in that case). This breaks sign-out for users without history state, rejecting legitimate sign-out requests.
The fix from commit 1fba0cab was correct: `if (Navigation.HistoryEntryState != null && !ValidateSignOutRequestState())` - only validate when history state exists.
```suggestion
if (Navigation.HistoryEntryState != null && !ValidateSignOutRequestState())
```
How can I resolve this? If you propose a fix, please make it concise.| // Ensure we're authenticated before proceeding with sign-out | ||
| await Task.Yield(); |
There was a problem hiding this comment.
logic: await Task.Yield() serves no purpose here
The comment says "Ensure we're authenticated before proceeding with sign-out" but Task.Yield() doesn't ensure authentication - it just yields control back to the task scheduler. The actual authentication check happens on line 293. This line should be removed.
| // Ensure we're authenticated before proceeding with sign-out | |
| await Task.Yield(); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs
Line: 290:291
Comment:
**logic:** `await Task.Yield()` serves no purpose here
The comment says "Ensure we're authenticated before proceeding with sign-out" but `Task.Yield()` doesn't ensure authentication - it just yields control back to the task scheduler. The actual authentication check happens on line 293. This line should be removed.
```suggestion
```
How can I resolve this? If you propose a fix, please make it concise.
Benchmark PR from qodo-benchmark#88