Closed pkarjala closed 1 week ago
rotp
is a dependency gem, that allows you to generate QRcodes.
And personally I want to keep the QRcode in app and not rely on a 3rd party for a security measure.
So I created a helper I use for generated the OTP QRCode.
def otp_rqr_image(otp_url)
return '' if otp_url.blank?
qr_code = RQRCode::QRCode.new(otp_url)
.as_png(resize_exactly_to: 300)
.to_data_url
image_tag(qr_code)
end
Thanks will check that out as well.
As a note, rotp
itself does not actually allow you to generate QR codes. It will generate the URI for it, but it does not generate codes itself.
Installing the https://github.com/whomwah/rqrcode gem allows the provided example to function correctly.
The docs need to be adjusted. I am for just removing this option?
I think removing it from the documentation and any code references would be a good solution.
Yes, no need for 'alternatives' really, let's just have one good working solution.
Instructions at https://github.com/wmlele/devise-otp/blob/master/docs/QR_CODES.md state you may use Google's API to generate a QR code. However, this API was deprecated some time ago as per https://groups.google.com/g/google-visualization-api/c/77YEadph9JY?pli=1
Recommend removing this method and/or replacing it with an alternative, and updating the documentation accordingly