< Summary - Syki

Information
Class: Syki.Back.Features.Identity.SetupTwoFactor.SetupTwoFactorController
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Identity/SetupTwoFactor/SetupTwoFactorController.cs
Tag: 56_26538939494
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 24
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
.ctor(...)100%11100%
Setup()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Identity/SetupTwoFactor/SetupTwoFactorController.cs

#LineLine coverage
 1namespace Syki.Back.Features.Identity.SetupTwoFactor;
 2
 3[ApiController, Authorize(Policies.SetupTwoFactor)]
 344public class SetupTwoFactorController(SetupTwoFactorService service) : ControllerBase
 5{
 6    /// <summary>
 7    /// Habilitar 2FA
 8    /// </summary>
 9    /// <remarks>
 10    /// Habilita a autenticação de dois fatores.
 11    /// </remarks>
 12    [HttpPost("identity/2fa-setup")]
 13    [SwaggerResponseExample(200, typeof(ResponseExamples))]
 14    [SwaggerResponseExample(400, typeof(ErrorsExamples))]
 15    public async Task<IActionResult> Setup([FromBody] SetupTwoFactorIn data)
 16    {
 3417        var result = await service.Setup(data.Token);
 3418        return result.Match<IActionResult>(Ok, BadRequest);
 3419    }
 20}
 21
 22internal class RequestExamples : ExamplesProvider<SetupTwoFactorIn>;
 23internal class ResponseExamples : ExamplesProvider<SuccessOut>;
 24internal class ErrorsExamples : ErrorExamplesProvider<InvalidTwoFactorToken>;