Skip to content

Commit

Permalink
Merge pull request #9 from anoopkarnik/main
Browse files Browse the repository at this point in the history
Corrected docker container ... redirect
  • Loading branch information
anoopkarnik authored Sep 3, 2024
2 parents b453d9d + d4c9e23 commit 913692e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions apps/dashboard-app/app/api/callback/openai/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import { NextRequest, NextResponse } from 'next/server';
export async function GET(req: NextRequest) {
const apiKey = req.nextUrl.searchParams.get('apiKey');
const type = 'OpenAI';
if (apiKey) {
return NextResponse.redirect(`${process.env.NEXT_PUBLIC_URL}/connections?apiKey=${apiKey}&type=${type}`);
}
return NextResponse.redirect(`${process.env.NEXT_PUBLIC_URL}/connections`);
const redirectUrl = apiKey
? `${ process.env.NEXT_PUBLIC_URL}/connections?apiKey=${apiKey}&type=${type}`
: `${ process.env.NEXT_PUBLIC_URL}/sconnections`;

console.log('Redirect URL:', redirectUrl);
console.log('NEXT_PUBLIC_URL:', process.env.NEXT_PUBLIC_URL);

return NextResponse.redirect(redirectUrl);
}

0 comments on commit 913692e

Please sign in to comment.