Skip to content

Commit 966b3bb

Browse files
cdxkerskeptrunedev
authored andcommitted
feat(shopify): add health check route
1 parent 7d3c283 commit 966b3bb

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • clients/trieve-shopify-extension/app/routes/_index

clients/trieve-shopify-extension/app/routes/_index/route.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import { validateTrieveAuth } from "app/auth";
33

44
export const loader = async ({ request }: LoaderFunctionArgs) => {
55
const url = new URL(request.url);
6-
// call validateTrieveAuth here to ensure the user is authenticated
7-
// The first time this gets called it will create a new dataset,
8-
// calling it here prevents race conditions.
9-
await validateTrieveAuth(request);
6+
if (url.searchParams.get("shop")) {
7+
// call validateTrieveAuth here to ensure the user is authenticated
8+
// The first time this gets called it will create a new dataset,
9+
// calling it here prevents race conditions.
10+
await validateTrieveAuth(request);
11+
throw redirect(`/app?${url.searchParams.toString()}`);
12+
}
1013

11-
throw redirect(`/app?${url.searchParams.toString()}`);
14+
return new Response("OK");
1215
};

0 commit comments

Comments
 (0)