From 1cc9bad29a68a6808427c34e0277b1d62931a749 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:39:22 +0200 Subject: [PATCH] fix: build errors --- apps/nextjs/src/app/api/[...trpc]/route.ts | 4 ++-- packages/api/src/router/apiKeys.ts | 2 +- packages/auth/callbacks.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/nextjs/src/app/api/[...trpc]/route.ts b/apps/nextjs/src/app/api/[...trpc]/route.ts index 378e11a403..73d86094ff 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 271f3d3d80..df5fd85d06 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 d8dc5675a3..67081df8ea 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"> => {