core/apps/webapp/app/routes/api.v1.oauth.callback.tsx
Harshith Mullapudi 54e535d57d
Feat: v2 (#12)
* Feat: v2

* feat: add chat functionality

* First cut: integrations

* Feat: add conversation API

* Enhance conversation handling and memory management

* Feat: added conversation

---------

Co-authored-by: Manoj K <saimanoj58@gmail.com>
2025-07-08 22:41:00 +05:30

22 lines
672 B
TypeScript

import { createActionApiRoute } from "~/services/routeBuilders/apiBuilder.server";
import { callbackHandler } from "~/services/oauth/oauth.server";
import type { CallbackParams } from "~/services/oauth/oauth-utils.server";
// This route handles the OAuth callback, similar to the NestJS controller
const { loader } = createActionApiRoute(
{
allowJWT: false,
corsStrategy: "all",
},
async ({ request }) => {
const url = new URL(request.url);
const params: CallbackParams = {};
for (const [key, value] of url.searchParams.entries()) {
params[key] = value;
}
return await callbackHandler(params, request);
},
);
export { loader };