Skip to content

Instantly share code, notes, and snippets.

@123ish
Created June 23, 2020 00:26
Show Gist options
  • Save 123ish/ac75c05032b62b1e197c4615cc61464d to your computer and use it in GitHub Desktop.
Save 123ish/ac75c05032b62b1e197c4615cc61464d to your computer and use it in GitHub Desktop.
How to implement two-factor authentication for Rails app by using Devise gem, Google authenticator, and ActiveModel::Otp gem: activate_2fa.html.erb
<# /app/views/users/activate_2fa.html.erb %>
<%= @svg.html_safe %>
<%= form_for(@user, url: activate_2fa_update_path) do |f| %>
<%= f.text_field :otp_response_code %>
<%= f.submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment