@@ -7,7 +7,6 @@ import EmailProvider from 'next-auth/providers/email'
7
7
import prisma from '@/api/models'
8
8
import nodemailer from 'nodemailer'
9
9
import { PrismaAdapter } from '@auth/prisma-adapter'
10
- import { NodeNextRequest , NodeNextResponse } from 'next/dist/server/base-http/node'
11
10
import { getToken , encode as encodeJWT } from 'next-auth/jwt'
12
11
import { datePivot } from '@/lib/time'
13
12
import { schnorr } from '@noble/curves/secp256k1'
@@ -130,7 +129,7 @@ function getCallbacks (req, res) {
130
129
const secret = process . env . NEXTAUTH_SECRET
131
130
const jwt = await encodeJWT ( { token, secret } )
132
131
const me = await prisma . user . findUnique ( { where : { id : token . id } } )
133
- setMultiAuthCookies ( new NodeNextRequest ( req ) , new NodeNextResponse ( res ) , { ...me , jwt } )
132
+ setMultiAuthCookies ( req , res , { ...me , jwt } )
134
133
}
135
134
136
135
return token
@@ -180,8 +179,7 @@ async function pubkeyAuth (credentials, req, res, pubkeyColumnName) {
180
179
const { k1, pubkey } = credentials
181
180
182
181
// are we trying to add a new account for switching between?
183
- const { body } = req . body
184
- const multiAuth = typeof body . multiAuth === 'string' ? body . multiAuth === 'true' : ! ! body . multiAuth
182
+ const multiAuth = typeof req . body . multiAuth === 'string' ? req . body . multiAuth === 'true' : ! ! req . body . multiAuth
185
183
186
184
try {
187
185
// does the given challenge (k1) exist in our db?
@@ -262,7 +260,7 @@ const getProviders = res => [
262
260
k1 : { label : 'k1' , type : 'text' }
263
261
} ,
264
262
authorize : async ( credentials , req ) => {
265
- return await pubkeyAuth ( credentials , new NodeNextRequest ( req ) , new NodeNextResponse ( res ) , 'pubkey' )
263
+ return await pubkeyAuth ( credentials , req , res , 'pubkey' )
266
264
}
267
265
} ) ,
268
266
CredentialsProvider ( {
@@ -273,7 +271,7 @@ const getProviders = res => [
273
271
} ,
274
272
authorize : async ( { event } , req ) => {
275
273
const credentials = await nostrEventAuth ( event )
276
- return await pubkeyAuth ( credentials , new NodeNextRequest ( req ) , new NodeNextResponse ( res ) , 'nostrAuthPubkey' )
274
+ return await pubkeyAuth ( credentials , req , res , 'nostrAuthPubkey' )
277
275
}
278
276
} ) ,
279
277
GitHubProvider ( {
0 commit comments