Skip to content

Commit

Permalink
Use viewbox: true option when creating QR code in otp feature, displa…
Browse files Browse the repository at this point in the history
…ys better and easier to style when using rqrcode 2+

The option is ignored in earlier versions, so no behavior change
there.  This makes the QR code slightly larger by default, but it
scales down better on smaller screen sizes.
  • Loading branch information
jeremyevans committed Nov 2, 2021
1 parent f91eb78 commit 33e7dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,5 +1,7 @@
=== master

* Use viewbox: true option when creating QR code in otp feature, displays better and easier to style when using rqrcode 2+ (jeremyevans)

* Make argon2 feature work with argon2 2.1.0+ (jeremyevans)

=== 2.17.0 (2021-09-24)
Expand Down
2 changes: 1 addition & 1 deletion lib/rodauth/features/otp.rb
Expand Up @@ -303,7 +303,7 @@ def otp_provisioning_name
end

def otp_qr_code
RQRCode::QRCode.new(otp_provisioning_uri).as_svg(:module_size=>8)
RQRCode::QRCode.new(otp_provisioning_uri).as_svg(:module_size=>8, :viewbox=>true)
end

def otp_user_key
Expand Down

0 comments on commit 33e7dbd

Please sign in to comment.