TwoFactorAuth.Net
TwoFactorAuth.Net copied to clipboard
QRCodeProvider - make GetUri public
To prevent the extra hop of downloading QR-image from the provider and then transferring it to the the client again - allow us to insert the URL into client's HTML directly.
Also your code for the default provider is the not most efficeint one (uses webclient - no connection caching, no async call etc, bu that's another issue)
To prevent the extra hop of downloading QR-image from the provider and then transferring it to the the client again - allow us to insert the URL into client's HTML directly.
I'm not quite sure I understand. Could you give an example?
The GetUri method appears 3 times in the code, and each time it's specific to that specific provider.
Also your code for the default provider is the not most efficeint one (uses webclient - no connection caching, no async call etc, bu that's another issue)
Yeah, I haven't come around to making it async and use a propery HttpClient / DI.
I'm not quite sure I understand. Could you give an example?
Sorry I wasn't clear.
The QR code providers that rely on 3rd party services first download the code from that service (e.g. image-charts) and then I can insert the resulting data-uri into my app's HTML.
How about allowing us to inserting the 3rd party image-generating API URL into html directly, so it's the client's browser that downloads the image, not my backend server?
<img src='@tfa.Something.GetUri()>
which would render
<img src='https://image-charts.com/chart?cht=qr&.....'>
BTW treat this as a low priority feature request and feel free to close ;)
BTW treat this as a low priority feature request and feel free to close ;)
No, it's about time I give this project a bit of love again. I'll see what I can do; no promises (yet) though 😉