private async Task LoadSharedKeyAndQrCodeUriAsync(string userId) { // Load the authenticator key & QR code URI to display on the form var unformattedKey = await _authenticatorService.GetAuthenticatorKeyAsync(userId); if (string.IsNullOrEmpty(unformattedKey)) { await _authenticatorService.ResetAuthenticatorKeyAsync(userId); unformattedKey = await _authenticatorService.GetAuthenticatorKeyAsync(userId); } SharedKey = FormatKey(unformattedKey); UserDTO user = await _identityService.GetUserById(userId); AuthenticatorUri = GenerateQrCodeUri(user.Email, unformattedKey); }