| | 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> |
| 0 | 12 | | @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 | | { |
| 0 | 43 | | _qrCodeLoading = true; |
| | 44 | |
|
| 0 | 45 | | var result = await Client.Get(); |
| 0 | 46 | | var email = (await AuthManager.GetUser()).Email; |
| 0 | 47 | | _key = result.Key; |
| 0 | 48 | | _qrCodeBase64 = result.QrCodeBase64; |
| | 49 | |
|
| 0 | 50 | | _qrCodeLoading = false; |
| 0 | 51 | | } |
| | 52 | | } |