mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 01:01:20 +10:00
fix: inital eslint errors
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { LRUCache } from "lru-cache";
|
||||
import prisma from "../db/database";
|
||||
import { Session, SessionProvider } from "./types";
|
||||
import type { Session, SessionProvider } from "./types";
|
||||
import { Prisma } from "@prisma/client";
|
||||
|
||||
export default function createDBSessionHandler(): SessionProvider {
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import { H3Event } from "h3";
|
||||
import type { H3Event } from "h3";
|
||||
import createMemorySessionProvider from "./memory";
|
||||
import { Session, SessionProvider } from "./types";
|
||||
import type { Session, SessionProvider } from "./types";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { parse as parseCookies } from "cookie-es";
|
||||
import { MinimumRequestObject } from "~/server/h3";
|
||||
import type { MinimumRequestObject } from "~/server/h3";
|
||||
import createDBSessionHandler from "./db";
|
||||
import { DateTime, DurationLike } from "luxon";
|
||||
import type { DurationLike } from "luxon";
|
||||
import { DateTime } from "luxon";
|
||||
|
||||
/*
|
||||
This implementation may need work.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Session, SessionProvider } from "./types";
|
||||
import type { Session, SessionProvider } from "./types";
|
||||
|
||||
export default function createMemorySessionHandler() {
|
||||
const sessions: { [key: string]: Session } = {};
|
||||
@ -21,7 +21,7 @@ export default function createMemorySessionHandler() {
|
||||
},
|
||||
async cleanupSessions() {
|
||||
const now = new Date();
|
||||
for (let token in sessions) {
|
||||
for (const token in sessions) {
|
||||
// if expires at time is before now, the session is expired
|
||||
if (sessions[token].expiresAt < now) await this.removeSession(token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user