Improvement of logout. Added Sacrital Service. Added website link for event places and direct link to other websites in worship overview
This commit is contained in:
26
utils/blacklist.js
Normal file
26
utils/blacklist.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const blacklist = new Map();
|
||||
const EXPIRATION_TIME = 24 * 60 * 60 * 1000; // 24 Stunden in Millisekunden
|
||||
|
||||
function cleanupBlacklist() {
|
||||
const now = Date.now();
|
||||
for (const [token, timestamp] of blacklist) {
|
||||
if (now - timestamp > EXPIRATION_TIME) {
|
||||
blacklist.delete(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addTokenToBlacklist(token) {
|
||||
cleanupBlacklist(); // Bereinige alte Einträge
|
||||
blacklist.set(token, Date.now());
|
||||
}
|
||||
|
||||
function isTokenBlacklisted(token) {
|
||||
cleanupBlacklist(); // Bereinige alte Einträge
|
||||
return blacklist.has(token);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
addTokenToBlacklist,
|
||||
isTokenBlacklisted,
|
||||
};
|
||||
Reference in New Issue
Block a user