ShiftScheduler/Client/Shared/MainLayout.razor
copilot-swe-agent[bot] 2443cc06a7 Add Google authentication with authorized email configuration
Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com>
2025-08-26 04:15:48 +00:00

33 lines
995 B
Text

@inherits LayoutComponentBase
@inject IJSRuntime JSRuntime
<div class="page">
<main>
<CascadingAuthenticationState>
<AuthorizeView>
<Authorized>
<AuthHeader Email="@GetEmailFromContext(context)" />
<article class="content px-4">
@Body
</article>
</Authorized>
<NotAuthorized>
<LoginDisplay ErrorMessage="@GetErrorMessage()" />
</NotAuthorized>
</AuthorizeView>
</CascadingAuthenticationState>
</main>
</div>
@code {
private string GetEmailFromContext(AuthenticationState authState)
{
return authState.User?.FindFirst(System.Security.Claims.ClaimTypes.Email)?.Value ?? "Unknown";
}
private string GetErrorMessage()
{
// Get error message from URL query parameters
return ""; // We'll handle this through JS if needed
}
}