mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-15 23:58:56 -05:00
remove unnecessary post request
This commit is contained in:
parent
16896db17c
commit
2d259d22b0
@ -1,6 +1,4 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '~/auth';
|
||||
import { getNeynarClient } from '~/lib/neynar';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
@ -43,43 +41,3 @@ export async function GET(request: Request) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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 { message, signature, signers, user } = body;
|
||||
|
||||
if (!message || !signature || !signers) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Message, signature, and signers are required' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
// Since we can't directly modify the session token here,
|
||||
// we'll return the data and let the client trigger a session update
|
||||
// The client will need to call getSession() to refresh the session
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: 'Session data prepared for update',
|
||||
signers,
|
||||
user,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error updating session signers:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to update session' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user