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:
Torsten Schulz
2024-09-06 16:34:17 +02:00
parent a869f2d16a
commit 5c6cfa41ab
14 changed files with 139 additions and 32 deletions

26
utils/blacklist.js Normal file
View 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,
};