0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Updated SingleUseToken grace period to 10 minutes (#13926)

refs https://github.com/TryGhost/Team/issues/1216

Some email security clients are scanning links at delivery, rather than
at the point the user clicks on them. This is causing magic links to
expire. To get around this we're increasing the grace period in which a
link can be used multiple times to 10 minutes.
This commit is contained in:
Fabien 'egg' O'Carroll 2022-01-03 17:55:53 +02:00 committed by GitHub
parent 507ae42205
commit bc75d20cef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -33,7 +33,7 @@ const SingleUseToken = ghostBookshelf.Model.extend({
} catch (err) {
logging.error(err);
}
}, 10000);
}, 10 * 60 * 1000);
}
return model;

View file

@ -34,7 +34,11 @@ describe('Unit: models/single-use-token', function () {
clock.tick(10000);
should.ok(destroyStub.called, 'destroy was called after 10 seconds');
should.ok(!destroyStub.called, 'destroy was not called after 10 seconds');
clock.tick(10 * 60 * 1000 - 10000);
should.ok(destroyStub.called, 'destroy was not called after 10 seconds');
});
});
});