< Summary

Information
Class: Syki.Front.Configs.AuthConfigs
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Configs/AuthConfigs.cs
Tag: 22_11348620282
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 22
Line coverage: 0%
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
AddAuthConfigs(...)100%210%

File(s)

/home/runner/work/syki/syki/Front/Configs/AuthConfigs.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Authorization;
 2using Microsoft.AspNetCore.Components.Authorization;
 3
 4namespace Syki.Front.Configs;
 5
 6public static class AuthConfigs
 7{
 8    public static void AddAuthConfigs(this WebAssemblyHostBuilder builder)
 9    {
 010        builder.Services.AddScoped<IAuthorizationHandler, SkipUserRegisterAuthReqHandler>();
 011        builder.Services.AddScoped<IAuthorizationHandler, CrossLoginAuthReqHandler>();
 12
 013        builder.Services.AddAuthorizationCore(options =>
 014        {
 015            options.AddPolicy(FrontPolicy.SkipUserRegister, p => p.Requirements.Add(new SkipUserRegisterAuthReq()));
 016            options.AddPolicy(FrontPolicy.CrossLogin, p => p.Requirements.Add(new CrossLoginAuthReq()));
 017        });
 18
 019        builder.Services.AddScoped<SykiAuthStateProvider>();
 020        builder.Services.AddScoped<AuthenticationStateProvider>(sp => sp.GetRequiredService<SykiAuthStateProvider>());
 021    }
 22}