-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10349 from 18F/stages/rc-2024-04-02
Deploy RC 368 to Prod
- Loading branch information
Showing
150 changed files
with
3,956 additions
and
963 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module AccountResetConcern | ||
include ActionView::Helpers::DateHelper | ||
def account_reset_deletion_period_interval(user) | ||
current_time = Time.zone.now | ||
|
||
distance_of_time_in_words( | ||
current_time, | ||
current_time + account_reset_wait_period_days(user), | ||
true, | ||
accumulate_on: reset_accumulation_type(user), | ||
) | ||
end | ||
|
||
def account_reset_wait_period_days(user) | ||
if supports_fraud_account_reset?(user) | ||
IdentityConfig.store.account_reset_fraud_user_wait_period_days.days | ||
else | ||
IdentityConfig.store.account_reset_wait_period_days.days | ||
end | ||
end | ||
|
||
def supports_fraud_account_reset?(user) | ||
IdentityConfig.store.account_reset_fraud_user_wait_period_days.present? && | ||
fraud_state?(user) | ||
end | ||
|
||
def fraud_state?(user) | ||
user.fraud_review_pending? || user.fraud_rejection? | ||
end | ||
|
||
def reset_accumulation_type(user) | ||
if account_reset_wait_period_days(user) > 3.days | ||
:days | ||
else | ||
:hours | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.