Skip to content

Conversation

@experian-greg-myers
Copy link

@experian-greg-myers experian-greg-myers commented Mar 29, 2021

Duplicate of: benjaminwols#2
#108
But merged into master.

Edit: Also merged #200 to fix tests.

Benjamin Wols and others added 30 commits November 9, 2016 11:56
gem "test-unit", "~> 3.0"
end

gem 'sprockets-rails', '~> 2.0'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sprockets 3 requires a manifest, pegged sprockets to 2 for duration of this branch so the manifest can be fixed separately.

<p><%= flash[:notice] %></p>

<%= form_tag([resource_name, :two_factor_authentication], :method => :put) do %>
<%= form_tag(verify_user_two_factor_authentication_path, method: :put) do %>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method name is not generic in this PR, seems to be locked to user for now.

require "active_model"
require "active_support/core_ext/class/attribute_accessors"
require "cgi"
require 'active_model'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #108 added an Activerecord dependency here that I removed in the merge. Unknown if it's needed but it doesn't seem to be and tests pass.


def send_new_otp_after_login?
!totp_enabled?
otp_enabled && !totp_enabled?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also a merge conflict resolution.

post :update, params: { code: code }
else
post :update, code: code
def post_params(action, params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces post_code method as there are some other params needing submission.

it "returns uri with user's email" do
expect(instance.provisioning_uri).
to match(%r{otpauth://totp/houdini@example.com\?secret=\w{32}})
to match(%r{otpauth://totp/houdini%40example.com\?secret=\w{32}})
Copy link
Author

@experian-greg-myers experian-greg-myers Mar 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New ROTP versions output URL encoded URLs hence the test change.
This will be incompatible with old ROTP versions if someone pegged the version down.

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

Successfully merging this pull request may close these issues.

2 participants