1
0
Kevin Matsubara c3df56b0da Add identity context and ASP.NET individual account pages for authorization.
I created a new Blazor project with individual accounts, then transferred the files over to the existing project.
Then renamed ApplicationDbContext to: IdentityContext to distinguish from the application context.
Then ran the update database command with the existing migration for identity.
2025-04-18 10:20:55 +02:00

30 lines
813 B
Plaintext

@if (!string.IsNullOrEmpty(DisplayMessage))
{
var statusMessageClass = DisplayMessage.StartsWith("Error") ? "danger" : "success";
<div class="alert alert-@statusMessageClass" role="alert">
@DisplayMessage
</div>
}
@code {
private string? messageFromCookie;
[Parameter]
public string? Message { get; set; }
[CascadingParameter]
private HttpContext HttpContext { get; set; } = default!;
private string? DisplayMessage => Message ?? messageFromCookie;
protected override void OnInitialized()
{
messageFromCookie = HttpContext.Request.Cookies[IdentityRedirectManager.StatusCookieName];
if (messageFromCookie is not null)
{
HttpContext.Response.Cookies.Delete(IdentityRedirectManager.StatusCookieName);
}
}
}