< Summary - Syki

Information
Class: Syki.Front.Features.Cross.GetMfaKey.MfaQrCode
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Features/Cross/GetMfaKey/MfaQrCode.razor
Tag: 4_16869239191
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 52
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
OnInitializedAsync()100%210%

File(s)

/home/runner/work/syki/syki/Front/Features/Cross/GetMfaKey/MfaQrCode.razor

#LineLine coverage
 1@namespace Syki.Front.Features.Cross.GetMfaKey
 2
 3<MudPaper>
 4    <MudCard Class="px-4 py-0" Elevation="0">
 5        <MudCardContent>
 6            <MudStack AlignItems="AlignItems.Center">
 7                <MudAlert NoIcon="true" Severity="Severity.Info" Variant="Variant.Text">
 8                    <MudStack Row="true" Justify="Justify.SpaceAround">
 9                        <MudText>Utilize o app Google Authenticator para ler o QR-Code</MudText>
 10                    </MudStack>
 11                </MudAlert>
 012                @if (_qrCodeLoading)
 13                {
 14                    <MudContainer MaxWidth="MaxWidth.False" Style="max-width: 380px" Class="px-0 d-flex align-center jus
 15                        <MudProgressCircular Class="py-10" Style="width: 50%; height: 50%" Color="Color.Dark" Indetermin
 16                    </MudContainer>
 17                }
 18                else
 19                {
 20                    <MudContainer MaxWidth="MaxWidth.False" Style="max-width: 380px" Class="px-0">
 21                        <MudImage Src="@_qrCodeBase64" Fluid="true" Elevation="25" Class="rounded-lg"/>
 22                    </MudContainer>
 23                    <MudContainer MaxWidth="MaxWidth.False" Style="max-width: 380px" Class="px-0">
 24                        <SykiTextField Value="@_key" CopyAdornment="true" ReadOnly="true" />
 25                    </MudContainer>
 26                }
 27            </MudStack>
 28        </MudCardContent>
 29    </MudCard>
 30</MudPaper>
 31
 32@inject GetMfaKeyClient Client
 33@inject AuthManager AuthManager
 34
 35@code
 36{
 37    private string _key;
 38    private string _qrCodeBase64;
 39    private bool _qrCodeLoading;
 40
 41    protected override async Task OnInitializedAsync()
 42    {
 043        _qrCodeLoading = true;
 44
 045        var result = await Client.Get();
 046        var email = (await AuthManager.GetUser()).Email;
 047        _key = result.Key;
 048        _qrCodeBase64 = result.QrCodeBase64;
 49
 050        _qrCodeLoading = false;
 051    }
 52}

Methods/Properties

OnInitializedAsync()