Browse Source

Provide `use_path` to qr generator for svg data size reduction (#32127)

dariusk-working/4_3_0
Matt Jankowski 1 year ago committed by Claire
parent
commit
ceba0f082e
  1. 2
      app/views/settings/two_factor_authentication/confirmations/new.html.haml
  2. 2
      spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb

2
app/views/settings/two_factor_authentication/confirmations/new.html.haml

@ -5,7 +5,7 @@
%p.hint= t('otp_authentication.instructions_html') %p.hint= t('otp_authentication.instructions_html')
.qr-wrapper .qr-wrapper
.qr-code!= @qrcode.as_svg(padding: 0, module_size: 4) .qr-code!= @qrcode.as_svg(padding: 0, module_size: 4, use_path: true)
.qr-alternative .qr-alternative
%p.hint= t('otp_authentication.manual_instructions') %p.hint= t('otp_authentication.manual_instructions')

2
spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb

@ -18,7 +18,7 @@ RSpec.describe Settings::TwoFactorAuthentication::ConfirmationsController do
def qr_code_markup def qr_code_markup
RQRCode::QRCode.new( RQRCode::QRCode.new(
'otpauth://totp/cb6e6126.ngrok.io:local-part%40domain?secret=thisisasecretforthespecofnewview&issuer=cb6e6126.ngrok.io' 'otpauth://totp/cb6e6126.ngrok.io:local-part%40domain?secret=thisisasecretforthespecofnewview&issuer=cb6e6126.ngrok.io'
).as_svg(padding: 0, module_size: 4) ).as_svg(padding: 0, module_size: 4, use_path: true)
end end
end end

Loading…
Cancel
Save