< Summary

Information
Class: Elsa.ExternalAuthentication.Endpoints.Broker.CompleteLogoutRequest
Assembly: Elsa.ExternalAuthentication
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Endpoints/Broker/CompleteLogout.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 34
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ConnectionKey()100%11100%
get_State()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Endpoints/Broker/CompleteLogout.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.ExternalAuthentication.Constants;
 3using Elsa.ExternalAuthentication.Services;
 4using Microsoft.AspNetCore.Builder;
 5
 6namespace Elsa.ExternalAuthentication.Endpoints.Broker;
 7
 8internal sealed class CompleteLogout(IExternalAuthenticationBroker broker) : ElsaEndpoint<CompleteLogoutRequest>
 9{
 10    public override void Configure()
 11    {
 12        Get("/external-authentication/logout/callback/{connectionKey}");
 13        AllowAnonymous();
 14        Options(x => x.RequireRateLimiting(ExternalAuthenticationRateLimitPolicyNames.ProviderCallback));
 15    }
 16
 17    public override async Task HandleAsync(CompleteLogoutRequest request, CancellationToken cancellationToken)
 18    {
 19        var result = await broker.CompleteLogoutAsync(Route<string>("connectionKey") ?? request.ConnectionKey ?? string.
 20        if (result.Error is { } error)
 21        {
 22            await BrokerEndpointSupport.SendErrorAsync(Send, error, cancellationToken);
 23            return;
 24        }
 25
 26        await Send.RedirectAsync(result.RedirectUri!.ToString(), false, true);
 27    }
 28}
 29
 30internal sealed class CompleteLogoutRequest
 31{
 132    public string? ConnectionKey { get; set; }
 133    public string? State { get; set; }
 34}

Methods/Properties

get_ConnectionKey()
get_State()