-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.DocsThis issue tracks updating documentationThis issue tracks updating documentationStatus: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-serverfeature-blazor-server-authquestion
Milestone
Description
Is it possible to access Blazor's AuthenticationStateProvider
from a DbContext or in Startup.Configure()
?
I receive this error:
GetAuthenticationStateAsync was called before SetAuthenticationState.
@Blackleones, did you ever get this line to work in your DbContext? ref #17442 (comment)
var userId = await _currentUserService.GetUserId();
mrlife and rrajewski
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.DocsThis issue tracks updating documentationThis issue tracks updating documentationStatus: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-serverfeature-blazor-server-authquestion