diff --git a/bin/init.js b/bin/init.js index a6cdee3..ebd19ef 100644 --- a/bin/init.js +++ b/bin/init.js @@ -714,16 +714,6 @@ export async function init(projectName = null, autoAcceptDefaults = false, apiKe } } - const updateSessionRoutePath = path.join(projectPath, 'src', 'app', 'api', 'auth', 'update-session', 'route.ts'); - if (fs.existsSync(updateSessionRoutePath)) { - fs.rmSync(updateSessionRoutePath, { force: true }); - // Remove the directory if it's empty - const updateSessionDir = path.dirname(updateSessionRoutePath); - if (fs.readdirSync(updateSessionDir).length === 0) { - fs.rmSync(updateSessionDir, { recursive: true, force: true }); - } - } - // Remove src/auth.ts file const authFilePath = path.join(projectPath, 'src', 'auth.ts'); if (fs.existsSync(authFilePath)) { diff --git a/src/app/api/auth/update-session/route.ts b/src/app/api/auth/update-session/route.ts deleted file mode 100644 index db4b4fc..0000000 --- a/src/app/api/auth/update-session/route.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { NextResponse } from 'next/server'; -import { getServerSession } from 'next-auth'; -import { authOptions } from '~/auth'; - -export async function POST(request: Request) { - try { - const session = await getServerSession(authOptions); - - if (!session?.user?.fid) { - return NextResponse.json( - { error: 'No authenticated session found' }, - { status: 401 } - ); - } - - const body = await request.json(); - const { signers, user } = body; - - if (!signers || !user) { - return NextResponse.json( - { error: 'Signers and user are required' }, - { status: 400 } - ); - } - - // For NextAuth to update the session, we need to trigger the JWT callback - // This is typically done by calling the session endpoint with updated data - // However, we can't directly modify the session token from here - - // Instead, we'll store the data temporarily and let the client refresh the session - // The session will be updated when the JWT callback is triggered - - return NextResponse.json({ - success: true, - message: 'Session update prepared', - signers, - user, - }); - } catch (error) { - console.error('Error preparing session update:', error); - return NextResponse.json( - { error: 'Failed to prepare session update' }, - { status: 500 } - ); - } -}