mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Do not require session confirmation for new users (#24799)
When making sensitive changes to an account (adding 2FA or passkeys), we require users to confirm their password. This is to prevent an attacker from adding 2FA to an account they have access to. However, on newly created accounts, we should not require this, it's an extra step and it doesn't provide extra security (since the account was just created). This commit makes it so that we don't require session confirmation for accounts created less than 5 minutes ago.
This commit is contained in:
@@ -9,6 +9,9 @@ describe "User preferences | Security", type: :system do
|
||||
|
||||
before do
|
||||
user.activate
|
||||
# testing the enforced 2FA flow requires a user that was created > 5 minutes ago
|
||||
user.created_at = 6.minutes.ago
|
||||
user.save!
|
||||
sign_in(user)
|
||||
|
||||
# system specs run on their own host + port
|
||||
|
||||
Reference in New Issue
Block a user