Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions app/decorators/user_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,6 @@ def lockout_time_remaining
(lockout_period - (Time.zone.now - user.second_factor_locked_at)).to_i
end

def confirmation_period_expired_error
I18n.t('errors.messages.confirmation_period_expired', period: confirmation_period)
end

def confirmation_period
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was used, but only in tests, the live usage is actually in ConfirmationEmailPresenter

current_time = Time.zone.now

distance_of_time_in_words(
current_time,
current_time + Devise.confirm_within,
true,
accumulate_on: :hours,
)
end

def active_identity_for(service_provider)
user.active_identities.find_by(service_provider: service_provider.issuer)
end
Expand Down
6 changes: 0 additions & 6 deletions app/forms/idv/phone_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ def user_has_multiple_phones?
@user.phone_configurations.many?
end

def phone_belongs_to_user?
@user.phone_configurations.any? do |configuration|
configuration.phone == phone
end
end

private

attr_writer :phone
Expand Down
4 changes: 0 additions & 4 deletions app/forms/openid_connect_authorize_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@ def ial
Saml::Idp::Constants::AUTHN_CONTEXT_CLASSREF_TO_IAL[ial_values.sort.max]
end

def aal
Saml::Idp::Constants::AUTHN_CONTEXT_CLASSREF_TO_AAL[aal_values.sort.max]
end
Comment on lines -202 to -204
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is very surprising to me that it's not used...? are we getting aal elsewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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


def extra_analytics_attributes
{
client_id: client_id,
Expand Down
8 changes: 0 additions & 8 deletions app/services/idv/steps/doc_auth_base_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,6 @@ def verify_step_document_capture_session_uuid_key
:idv_verify_step_document_capture_session_uuid
end

def cac_verify_document_capture_session_uuid_key
:cac_verify_step_document_capture_session_uuid
end

def recover_verify_document_capture_session_uuid_key
:idv_recover_verify_step_document_capture_session_uuid
end

def verify_document_capture_session_uuid_key
:verify_document_action_document_capture_session_uuid
end
Expand Down
5 changes: 0 additions & 5 deletions app/services/idv/steps/link_sent_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ def handle_document_verification_success(get_results_response)
mark_steps_complete
end

def handle_document_verification_failure(get_results_response)
mark_step_incomplete(:send_link)
failure(get_results_response.first_error_message, get_results_response.to_h)
end

def render_document_capture_cancelled
mark_steps_incomplete
redirect_to idv_url
Expand Down
16 changes: 16 additions & 0 deletions spec/services/funnel/doc_auth/log_document_error_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'rails_helper'

describe Funnel::DocAuth::LogDocumentError do
describe '::call' do
it 'sets last error when doc auth log exists' do
doc_auth_log = create(:doc_auth_log, user_id: 1)
puts Funnel::DocAuth::LogDocumentError.call(1, 'test')
expect(doc_auth_log.reload.last_document_error).to eq 'test'
end

it 'returns nil if doc auth log does not exist' do
result = Funnel::DocAuth::LogDocumentError.call(1, 'test')
expect(result).to eq nil
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
it 'mentions how long the user has to confirm' do
user = build_stubbed(:user, confirmed_at: Time.zone.now)
assign(:resource, user)
assign(:confirmation_period, user.decorate.confirmation_period)
presenter = ConfirmationEmailPresenter.new(user, self)
assign(:confirmation_period, presenter.confirmation_period)
render

expect(rendered).to have_content(
t(
'user_mailer.email_confirmation_instructions.footer',
confirmation_period: user.decorate.confirmation_period,
confirmation_period: presenter.confirmation_period,
),
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
it 'states that the email is not associated with a user account' do
user = build_stubbed(:user, confirmed_at: nil)
assign(:resource, user)
assign(:confirmation_period, user.decorate.confirmation_period)
presenter = ConfirmationEmailPresenter.new(user, self)
assign(:confirmation_period, presenter.confirmation_period)
render

expect(rendered).to have_content(
Expand All @@ -17,21 +18,22 @@
expect(rendered).to have_content(
t(
'user_mailer.email_confirmation_instructions.footer',
confirmation_period: user.decorate.confirmation_period,
confirmation_period: presenter.confirmation_period,
),
)
end

it 'mentions how long the user has to confirm' do
user = build_stubbed(:user, confirmed_at: nil)
assign(:resource, user)
assign(:confirmation_period, user.decorate.confirmation_period)
presenter = ConfirmationEmailPresenter.new(user, self)
assign(:confirmation_period, presenter.confirmation_period)
render

expect(rendered).to have_content(
t(
'user_mailer.email_confirmation_instructions.footer',
confirmation_period: user.decorate.confirmation_period,
confirmation_period: presenter.confirmation_period,
),
)
end
Expand Down