-
Notifications
You must be signed in to change notification settings - Fork 270
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature enable otp #201
base: master
Are you sure you want to change the base?
Feature enable otp #201
Conversation
…ed but is tfa is needed
@@ -19,7 +19,7 @@ gem "rails", rails | |||
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.0') | |||
gem "test-unit", "~> 3.0" | |||
end | |||
|
|||
gem 'sprockets-rails', '~> 2.0' |
There was a problem hiding this comment.
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.
@@ -6,7 +6,7 @@ | |||
|
|||
<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 %> |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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.
@@ -66,11 +66,11 @@ def send_new_otp(options = {}) | |||
end | |||
|
|||
def send_new_otp_after_login? | |||
!totp_enabled? | |||
otp_enabled && !totp_enabled? |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
@@ -138,7 +138,7 @@ def instance.send_two_factor_authentication_code(code) | |||
|
|||
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}}) |
There was a problem hiding this comment.
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.
Duplicate of: benjaminwols#2
#108
But merged into master.
Edit: Also merged #200 to fix tests.