-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6440 Configure admin and user reset token expiry separately (#4447)
AO3-6440 Configure admin and user reset token expiry separately
- Loading branch information
Showing
9 changed files
with
58 additions
and
4 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
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 |
---|---|---|
|
@@ -19,6 +19,9 @@ REMEMBERED_SESSION_LENGTH_IN_MONTHS: 3 | |
# also change the message (and vice versa). | ||
DAYS_UNTIL_RESET_PASSWORD_LINK_EXPIRES: 7 | ||
|
||
# This also affects the link included in the admin account creation email. | ||
DAYS_UNTIL_ADMIN_RESET_PASSWORD_LINK_EXPIRES: 5 | ||
|
||
# email addresses | ||
RETURN_ADDRESS: '[email protected]' | ||
SPAM_ALERT_ADDRESS: '[email protected]' | ||
|
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 |
---|---|---|
|
@@ -36,6 +36,19 @@ Feature: Authenticate Admin Users | |
Then I should see "Your password has been changed successfully. You are now signed in." | ||
And I should see "Hi, admin!" | ||
|
||
Scenario: Set password link expires. | ||
Given the following admin exists | ||
| login | password | email | | ||
| admin | testpassword | admin@example.com | | ||
Then 1 email should be delivered to "[email protected]" | ||
When it is past the admin password reset token's expiration date | ||
And I follow "follow this link to set your password" in the email | ||
Then I should see "Set My Admin Password" | ||
When I fill in "New password" with "newpassword" | ||
And I fill in "Confirm new password" with "newpassword" | ||
And I press "Set Admin Password" | ||
Then I should see "Reset password token has expired, please request a new one" | ||
|
||
Scenario: Admin can log in. | ||
Given I have no users | ||
And the following admin exists | ||
|
@@ -88,6 +101,26 @@ Feature: Authenticate Admin Users | |
Then I should see "Your password has been changed successfully. You are now signed in." | ||
And I should see "Hi, admin!" | ||
|
||
Scenario: Reset password link expires. | ||
Given the following admin exists | ||
| login | password | email | | ||
| admin | testpassword | admin@example.com | | ||
And all emails have been delivered | ||
When I go to the admin login page | ||
And I follow "Forgot admin password?" | ||
Then I should see "Forgotten your admin password?" | ||
When I fill in "Admin user name" with "admin" | ||
And I press "Reset Admin Password" | ||
Then I should see "Check your email for instructions on how to reset your password." | ||
And 1 email should be delivered to "[email protected]" | ||
When it is past the admin password reset token's expiration date | ||
And I follow "Change my password" in the email | ||
Then I should see "Set My Admin Password" | ||
When I fill in "New password" with "newpassword" | ||
And I fill in "Confirm new password" with "newpassword" | ||
And I press "Set Admin Password" | ||
Then I should see "Reset password token has expired, please request a new one" | ||
|
||
Scenario: Locked admin cannot sign in. | ||
Given the admin "admin" is locked | ||
When I go to the admin login page | ||
|
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