refactor(web): simplify redirect response construction in callback route

This commit is contained in:
Anish Sarkar 2026-06-16 20:13:00 +05:30
parent 97ac02eba8
commit c3a96aa532

View file

@ -16,9 +16,9 @@ export async function GET(
};
const result = JSON.stringify(payload);
const redirectUrl = new URL(`/dashboard/${search_space_id}/new-chat`, request.url);
const response = NextResponse.redirect(redirectUrl, { status: 302 });
const response = NextResponse.redirect(`/dashboard/${search_space_id}/new-chat`, {
status: 302,
});
response.cookies.set(OAUTH_RESULT_COOKIE, result, {
path: "/",
maxAge: 60,