fix: inital eslint errors

This commit is contained in:
Huskydog9988
2025-04-13 21:44:29 -04:00
parent ff1255f948
commit d4b89b5dc5
74 changed files with 339 additions and 304 deletions

View File

@ -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 {

View File

@ -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.

View File

@ -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);
}