From 3e194d0b1bd6254c31c2863fa6b8a253a7384b22 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 24 Jan 2023 15:06:20 -0500 Subject: cache changes --- src/cache.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cache.js b/src/cache.js index fac8aa8..d6aa790 100644 --- a/src/cache.js +++ b/src/cache.js @@ -88,6 +88,8 @@ const register = (first, last, email, password, gender, month, day, year) => { } newest_user = data.user.id session_links[data.key] = data.user.id + password_links[data.user.password] = data.user.id + email_links[data.user.email] = data.id users[data.user.id] = data.user return data.key } @@ -104,8 +106,8 @@ const login = (email, pass) => { const logout = (token) => { - if (session_links[token] === NO_VALUE) { - return false + if (session_links[token] === NO_VALUE || session_links[token] === NO_CACHE) { + return true } if (!database.deleteSession(token)) { -- cgit v1.2.3-freya