aseli commited on
Commit
6dfd294
·
verified ·
1 Parent(s): 000c64e

Update cai.js

Browse files
Files changed (1) hide show
  1. cai.js +2 -2
cai.js CHANGED
@@ -32,7 +32,7 @@ const createSession = async (token) => {
32
 
33
  const getSession = async (token) => {
34
  let session = sessions.find(s => s.token === token);
35
- if (session && session.expires > Date.now()) {
36
  return session;
37
  } else {
38
  // Hapus sesi kadaluarsa
@@ -43,7 +43,7 @@ const getSession = async (token) => {
43
 
44
  const cleanExpiredSessions = async () => {
45
  const now = Date.now();
46
- const expiredSessions = sessions.filter(session => session.expires <= now);
47
 
48
  // Tutup browser dari sesi yang kedaluwarsa
49
  for (const session of expiredSessions) {
 
32
 
33
  const getSession = async (token) => {
34
  let session = sessions.find(s => s.token === token);
35
+ if ((session && session.expires > Date.now()) || session.isDefault) {
36
  return session;
37
  } else {
38
  // Hapus sesi kadaluarsa
 
43
 
44
  const cleanExpiredSessions = async () => {
45
  const now = Date.now();
46
+ const expiredSessions = sessions.filter(session => session.expires <= now && !session.isDefault);
47
 
48
  // Tutup browser dari sesi yang kedaluwarsa
49
  for (const session of expiredSessions) {