Skip to content

Commit

Permalink
chore(astro): Only run fix on netlify env
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Dec 10, 2024
1 parent 7a38560 commit 8f8401d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/astro/src/server/clerk-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ Check if signInUrl is missing from your configuration or if it is not an absolut
* doesn't serve a cached response during the authentication flow.
*/
function handleNetlifyCacheInDevInstance(locationHeader: string, requestState: RequestState) {
// Only run on Netlify environment
// eslint-disable-next-line turbo/no-undeclared-env-vars
if (!process.env.NETLIFY) {
return;
}

const hasHandshakeQueryParam = locationHeader.includes('__clerk_handshake');
// If location header is the original URL before the handshake redirects, add cache bust param
if (!hasHandshakeQueryParam) {
Expand Down

0 comments on commit 8f8401d

Please sign in to comment.