Skip to content
代码片段 群组 项目
未验证 提交 2f3ecb0c 编辑于 作者: Axel von Bertoldi's avatar Axel von Bertoldi
浏览文件

Attempt to increase the validity period of verification emails

For incident-17404: Attempt to increase the validity period verification
and password reset emails from 1 hour to 4 hours.

REVET THIS CHANGE ONCE THE INCIDENT HAS BEEN RESOLVED!!!
上级 eb569826
No related branches found
No related tags found
无相关合并请求
...@@ -5,7 +5,7 @@ module EmailVerification ...@@ -5,7 +5,7 @@ module EmailVerification
class ValidateTokenService < EmailVerification::BaseService class ValidateTokenService < EmailVerification::BaseService
include ActionView::Helpers::DateHelper include ActionView::Helpers::DateHelper
TOKEN_VALID_FOR_MINUTES = 60 TOKEN_VALID_FOR_MINUTES = 240
def initialize(attr:, user:, token:) def initialize(attr:, user:, token:)
super(attr: attr, user: user) super(attr: attr, user: user)
......
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
context 'when an expired verification_token param exists' do context 'when an expired verification_token param exists' do
before do before do
user.update!(locked_at: 1.hour.ago) user.update!(locked_at: 4.hours.ago)
post(user_session_path(user: { verification_token: 'token' })) post(user_session_path(user: { verification_token: 'token' }))
end end
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
context 'when email reset has already been offered' do context 'when email reset has already been offered' do
before do before do
user.update!(email_reset_offered_at: 1.hour.ago, email: 'new@email') user.update!(email_reset_offered_at: 4.hours.ago, email: 'new@email')
end end
it 'does not change the email_reset_offered_at field' do it 'does not change the email_reset_offered_at field' do
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
end end
context 'when expired' do context 'when expired' do
let(:token_generated_at) { 2.hours.ago } let(:token_generated_at) { 5.hours.ago }
it 'returns a failure status' do it 'returns a failure status' do
expect(service.execute).to eq( expect(service.execute).to eq(
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册