File tree Expand file tree Collapse file tree
clients/trieve-shopify-extension/app/routes/_index Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,10 +3,13 @@ import { validateTrieveAuth } from "app/auth";
33
44export 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} ;
You can’t perform that action at this time.
0 commit comments