-
Notifications
You must be signed in to change notification settings - Fork 287
Fix SignOutSessionStateManager compilation error for .NET 11+ #5086
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| using Microsoft.AspNetCore.Components; | ||
| using Microsoft.AspNetCore.Components.WebAssembly.Authentication; | ||
|
|
||
| namespace BlazingPizza.Client.Shared; | ||
|
|
||
| public partial class LoginDisplay | ||
| { | ||
| [Inject] | ||
| private NavigationManager Navigation { get; set; } = default!; | ||
|
|
||
| #if !NET11_0_OR_GREATER | ||
| [Inject] | ||
| private SignOutSessionStateManager SignOutManager { get; set; } = default!; | ||
| #endif | ||
|
|
||
| #if NET11_0_OR_GREATER | ||
| private void BeginSignOut() | ||
| { | ||
| Navigation.NavigateToLogout("authentication/logout"); | ||
| } | ||
| #else | ||
| private async Task BeginSignOut() | ||
| { | ||
| await SignOutManager.SetSignOutState(); | ||
| Navigation.NavigateTo("authentication/logout"); | ||
| } | ||
| #endif | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||||
| using Microsoft.AspNetCore.Components; | ||||||||
| using Microsoft.AspNetCore.Components.WebAssembly.Authentication; | ||||||||
|
||||||||
| using Microsoft.AspNetCore.Components.WebAssembly.Authentication; | |
| using Microsoft.AspNetCore.Components.WebAssembly.Authentication; | |
| using System.Threading.Tasks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing using directive for System.Threading.Tasks. The Task type used in the async BeginSignOut method (line 22) requires an explicit using directive. Other files in this project (e.g., OrdersClient.cs, Program.cs) explicitly include this using statement, and it should be added here for consistency and to ensure compilation succeeds across all target frameworks, especially when implicit usings may not be enabled.