diff --git a/pages/api/utils/pagePropsHelpers.ts b/pages/api/utils/pagePropsHelpers.ts index 85e8b3936..f08ec30f9 100644 --- a/pages/api/utils/pagePropsHelpers.ts +++ b/pages/api/utils/pagePropsHelpers.ts @@ -57,11 +57,10 @@ export const ensureSessionAndAccountList: GetServerSideProps = async ( }; } - // Redirect to the default account list if the "_" is where the account list ID would be in the URL - // This is a common pattern in our app, so we handle it here to avoid repeating - const ssrClient = makeSsrClient(session.user.apiToken); - if ((context.req.url ?? '').includes('/accountLists/_')) { + // Redirect to the default account list if the "_" is where the account list ID would be in the URL + // This is a common pattern in our app, so we handle it here to avoid repeating + const ssrClient = makeSsrClient(session.user.apiToken); const { data } = await ssrClient.query({ query: GetDefaultAccountDocument, });