diff --git a/apps/nextjs/src/app/api/[...trpc]/route.ts b/apps/nextjs/src/app/api/[...trpc]/route.ts index 378e11a40..73d86094f 100644 --- a/apps/nextjs/src/app/api/[...trpc]/route.ts +++ b/apps/nextjs/src/app/api/[...trpc]/route.ts @@ -13,7 +13,7 @@ const handlerAsync = async (req: Request) => { let session: Session | null; logger.info( - "Creating OpenAPI fetch handler for user " + (apiKeyHeaderValue ? "with an api key" : "without an api key"), + `Creating OpenAPI fetch handler for user ${apiKeyHeaderValue ? "with an api key" : "without an api key"}`, ); if (apiKeyHeaderValue !== null) { @@ -46,7 +46,7 @@ const handlerAsync = async (req: Request) => { req, endpoint: "/", router: appRouter, - createContext: () => createTRPCContext({ session: session, headers: req.headers }), + createContext: () => createTRPCContext({ session, headers: req.headers }), }); }; diff --git a/packages/api/src/router/apiKeys.ts b/packages/api/src/router/apiKeys.ts index 271f3d3d8..df5fd85d0 100644 --- a/packages/api/src/router/apiKeys.ts +++ b/packages/api/src/router/apiKeys.ts @@ -31,7 +31,7 @@ export const apiKeysRouter = createTRPCRouter({ await db.insert(apiKeys).values({ id: createId(), apiKey: hashedRandomToken, - salt: salt, + salt, userId: ctx.session.user.id, }); return { diff --git a/packages/auth/callbacks.ts b/packages/auth/callbacks.ts index d8dc5675a..67081df8e 100644 --- a/packages/auth/callbacks.ts +++ b/packages/auth/callbacks.ts @@ -1,9 +1,9 @@ import { cookies } from "next/headers"; import type { Adapter } from "@auth/core/adapters"; -import type { Session } from "@auth/core/types"; import dayjs from "dayjs"; import type { NextAuthConfig } from "next-auth"; +import type { Session } from "@homarr/auth"; import type { Database } from "@homarr/db"; import { eq, inArray } from "@homarr/db"; import { groupMembers, groupPermissions, users } from "@homarr/db/schema/sqlite"; @@ -43,7 +43,7 @@ export const createSessionAsync = async ( permissions: await getCurrentUserPermissionsAsync(db, user.id), colorScheme: "auto", }, - } satisfies Session; + } as Session; }; export const createSessionCallback = (db: Database): NextAuthCallbackOf<"session"> => {