Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign in via QR code 馃摳 #210

Closed
yshmarov opened this issue Mar 10, 2024 · 3 comments
Closed

sign in via QR code 馃摳 #210

yshmarov opened this issue Mar 10, 2024 · 3 comments

Comments

@yshmarov
Copy link
Contributor

I think it could be a great additional feature to enable sign in via QR code using rqrcode.

I managed to add it to my app by adding this code to app/views/passwordless/mailer/sign_in.html.erb:

ruby
<% qrcode = RQRCode::QRCode.new(@magic_link) %>

<% svg = qrcode.as_svg(
  offset: 0,
  color: '000',
  shape_rendering: 'crispEdges',
  module_size: 11,
  viewbox: true, # to control width within div. if not true, width is controlled by module_size
  standalone: true) %>

<div style="width: 200px;">
  <%= raw svg %>
</div>

result:

Screenshot 2024-03-10 at 16 12 06

Although so far I did not find a nice way to display the QR code in plain-text email:

Screenshot 2024-03-10 at 16 16 57
@mikker
Copy link
Owner

mikker commented Mar 10, 2024

That's nice! I don't think it should go into the stock setup, adding a dependency and all.

I do however love having an example like this around. Let's add it to the docs or perhaps the wiki instead?

@yshmarov
Copy link
Contributor Author

That's nice! I don't think it should go into the stock setup, adding a dependency and all.

I do however love having an example like this around. Let's add it to the docs or perhaps the wiki instead?

Added to wiki

@mikker
Copy link
Owner

mikker commented Mar 11, 2024

Wonderful! Thank you again @yshmarov 馃挋馃挍

@mikker mikker closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants