You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
961 B

using IdentityServer.DDD.Contracts.Models;
using Microsoft.AspNetCore.Components;
namespace IdentityServer.Pages.Authentication;
public partial class Logout
{
[Parameter]
[SupplyParameterFromQuery]
public string LogoutId { get; set; }
public LogOutModel LogOutModel { get; set; }
protected override void OnInitialized()
{
LogOutModel ??= new LogOutModel();
LogOutModel.Prompt = true;
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
LogOutModel = await Spa.GetLogOutAsync(LogoutId);
if (LogOutModel.Prompt)
{
StateHasChanged();
}
else
{
await HandleSubmit();
}
}
}
private async Task HandleSubmit()
{
LogOutModel = await Spa.PostLogOutAsync(LogoutId);
}
[Inject] SpaService Spa { get; set; }
}