diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Deployments.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Deployments.razor index 573d1d6..be5ddca 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Deployments.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Deployments.razor @@ -1,5 +1,6 @@ @page "/deployments" @using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.EntityFrameworkCore @using ZB.MOM.WW.OtOpcUa.Commons.Interfaces @using ZB.MOM.WW.OtOpcUa.Commons.Messages.Admin @@ -12,6 +13,7 @@ @inject IDbContextFactory DbFactory @inject IAdminOperationsClient AdminOps +@inject AuthenticationStateProvider AuthState @rendermode InteractiveServer Deployments @@ -103,8 +105,10 @@ _lastMessage = null; try { + var auth = await AuthState.GetAuthenticationStateAsync(); + var createdBy = auth.User.Identity?.Name ?? "(anonymous)"; var result = await AdminOps.StartDeploymentAsync( - createdBy: "(current user)", // F18: thread HttpContext.User.Identity.Name through + createdBy: createdBy, ct: CancellationToken.None); _lastSuccess = result.Outcome == StartDeploymentOutcome.Accepted;