-
Notifications
You must be signed in to change notification settings - Fork 166
LG-14231: Users can't access accounts after enrollment expires #11105
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
Changes from all commits
dd346fe
014dc06
a97efcd
685dd77
554c8f6
2e4dda5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -196,6 +196,14 @@ def deactivate_due_to_gpo_expiration | |
| ) | ||
| end | ||
|
|
||
| def deactivate_due_to_ipp_expiration | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might recommend writing tests for this in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See 554c8f6. |
||
| update!( | ||
| active: false, | ||
| deactivation_reason: :verification_cancelled, | ||
| in_person_verification_pending_at: nil, | ||
| ) | ||
| end | ||
|
|
||
| def deactivate_for_in_person_verification | ||
| update!(active: false, in_person_verification_pending_at: Time.zone.now) | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,6 +259,12 @@ | |
|
|
||
| before do | ||
| enrollment_records = InPersonEnrollment.where(id: pending_enrollments.map(&:id)) | ||
| # Below sets in_person_verification_pending_at | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be done in the factory trait for pending in-person enrollments?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a ticket for refactoring the |
||
| # on the profile associated with each pending enrollment | ||
| enrollment_records.each do |enrollment| | ||
| profile = enrollment.profile | ||
| profile.update(in_person_verification_pending_at: enrollment.created_at) | ||
| end | ||
| allow(InPersonEnrollment).to receive(:needs_usps_status_check). | ||
| and_return(enrollment_records) | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) | ||
|
|
@@ -877,6 +883,15 @@ | |
| ) | ||
| end | ||
|
|
||
| it 'deactivates the associated profile' do | ||
| job.perform(Time.zone.now) | ||
|
|
||
| pending_enrollment.reload | ||
| expect(pending_enrollment.profile).not_to be_active | ||
| expect(pending_enrollment.profile.in_person_verification_pending_at).to be_nil | ||
| expect(pending_enrollment.profile.deactivation_reason).to eq('verification_cancelled') | ||
| end | ||
|
|
||
| context 'when the in_person_stop_expiring_enrollments flag is true' do | ||
| before do | ||
| allow(IdentityConfig.store).to( | ||
|
|
@@ -897,6 +912,14 @@ | |
| ), | ||
| ) | ||
| end | ||
|
|
||
| it 'does not deactivate the profile' do | ||
| job.perform(Time.zone.now) | ||
|
|
||
| pending_enrollment.reload | ||
| expect(pending_enrollment.profile.in_person_verification_pending_at).to_not be_nil | ||
| expect(pending_enrollment.profile.deactivation_reason).to be_nil | ||
| end | ||
| end | ||
| end | ||
|
|
||
|
|
||
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.
Seeing that this largely follows from the equivalent GPO behavior, would we have a similar need to track the "expired at" value as is done with GPO?
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.
If we need to see when an
in_person_enrollmentwas expired, we could inspect thein_person_enrollment'sstatus_check_completed_atfield. It's set in theGetUspsProofingResultsJobwhen we expire an enrollment.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.
I think for parity with other profile features we should get an
ipp_enrollment_expired_atfield added toProfile, then use thestatus_check_completed_atto seed those values.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.
(That does not need to block this PR though)