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
11 changes: 8 additions & 3 deletions app/controllers/idv/by_mail/enter_code_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def index
end

def pii
Pii::Cacher.new(current_user, user_session).fetch
Pii::Cacher.new(current_user, user_session).
fetch(current_user.gpo_verification_pending_profile.id)
end

def create
Expand All @@ -61,8 +62,12 @@ def create
)

if !result.success?
flash[:error] = @gpo_verify_form.errors.first.message if !rate_limiter.limited?
redirect_to idv_verify_by_mail_enter_code_url
if rate_limiter.limited?
redirect_to idv_enter_code_rate_limited_url
else
flash[:error] = @gpo_verify_form.errors.first.message if !rate_limiter.limited?
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to get to the code in this else statement if the rate_limiter is limited? Just wondering if the if !rate_limiter.limited? statement is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because the rate limiter may have been incremented during the form submission.

redirect_to idv_verify_by_mail_enter_code_url
end
return
end

Expand Down
Loading