Skip to content

The Open Source DocuSign Alternative.

Merge branch 'main' into feat/add-kysely

Lucas Smith27fe8c7f8fe8
diff --cc package-lock.json
index bd03a6627,685181df1..6f86cfb5f
--- a/package-lock.json
+++ b/package-lock.json
@@@ -26519,7 -24956,7 +26766,8 @@@
"next-auth": "4.24.5",
"oslo": "^0.17.0",
"pdf-lib": "^1.17.1",
+ "pg": "^8.11.3",
+ "playwright": "1.43.0",
"react": "18.2.0",
"remeda": "^1.27.1",
"stripe": "^12.7.0",
diff --cc packages/lib/next-auth/auth-options.ts
index f04de55f8,6805eedbe..29b05e09c
--- a/packages/lib/next-auth/auth-options.ts
+++ b/packages/lib/next-auth/auth-options.ts
@@@ -1,6 -1,7 +1,7 @@@
/// <reference types="../types/next-auth.d.ts" />
-import { PrismaAdapter } from '@next-auth/prisma-adapter';
+import { KyselyAdapter } from '@auth/kysely-adapter';
import { compare } from '@node-rs/bcrypt';
+ import { verifyAuthenticationResponse } from '@simplewebauthn/server';
import { DateTime } from 'luxon';
import type { AuthOptions, Session, User } from 'next-auth';
import type { JWT } from 'next-auth/jwt';
@@@ -17,13 -19,14 +19,16 @@@ import { validateTwoFactorAuthenticatio
import { getMostRecentVerificationTokenByUserId } from '../server-only/user/get-most-recent-verification-token-by-user-id';
import { getUserByEmail } from '../server-only/user/get-user-by-email';
import { sendConfirmationToken } from '../server-only/user/send-confirmation-token';
+ import type { TAuthenticationResponseJSONSchema } from '../types/webauthn';
+ import { ZAuthenticationResponseJSONSchema } from '../types/webauthn';
import { extractNextAuthRequestMetadata } from '../universal/extract-request-metadata';
+ import { getAuthenticatorOptions } from '../utils/authenticator';
import { ErrorCode } from './error-codes';
+import { db } from './kysely-db/db';
export const NEXT_AUTH_OPTIONS: AuthOptions = {
- adapter: PrismaAdapter(prisma),
+ //@ts-expect-error - https://github.com/nextauthjs/next-auth/issues/8660
+ adapter: KyselyAdapter(db),
secret: process.env.NEXTAUTH_SECRET ?? 'secret',
session: {
strategy: 'jwt',
diff --cc packages/lib/package.json
index df122ef29,c6144df92..e5678c604
--- a/packages/lib/package.json
+++ b/packages/lib/package.json
@@@ -41,7 -39,7 +41,8 @@@
"next-auth": "4.24.5",
"oslo": "^0.17.0",
"pdf-lib": "^1.17.1",
+ "pg": "^8.11.3",
+ "playwright": "1.43.0",
"react": "18.2.0",
"remeda": "^1.27.1",
"stripe": "^12.7.0",
@@@ -50,6 -48,6 +51,7 @@@
},
"devDependencies": {
"@types/luxon": "^3.3.1",
+ "@types/pg": "^8.11.4"
+ "@playwright/browser-chromium": "1.43.0"
}
- }
+ }