mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Deleted all SingleUseTokens on boot
refs https://github.com/TryGhost/Team/issues/1216 Since we are increasing the grace period to 10 minutes, we want to make sure that server crashes during those 10 minutes do not cause single use tokens to remain in the system. The quickest was to ensure that without restartable background jobs is to delete all tokens upon boot.
This commit is contained in:
parent
bfacca3035
commit
4d457461c9
@ -175,6 +175,15 @@ const membersService = {
|
||||
logging.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const collection = await models.SingleUseToken.fetchAll();
|
||||
await collection.invokeThen('destroy');
|
||||
} catch (err) {
|
||||
logging.error(err);
|
||||
}
|
||||
})();
|
||||
},
|
||||
contentGating: require('./content-gating'),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user