From 67a840915de8f4b01bc0705cfc69da0c298f55f2 Mon Sep 17 00:00:00 2001 From: Callum Kloos <44029756+Callumk7@users.noreply.github.com> Date: Tue, 2 Jan 2024 13:57:21 +0000 Subject: [PATCH] Update oauth-with-pkce-flow-for-ssr.mdx (#20071) I moved the headers declaration outside of the if statement code block, as in the example, we are required to provide these headers to the redirect if the code fails. --- .../guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/docs/pages/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx b/apps/docs/pages/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx index 71a2a5502ad..884460b3c92 100644 --- a/apps/docs/pages/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx +++ b/apps/docs/pages/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx @@ -156,11 +156,10 @@ export async function loader({ request }: LoaderFunctionArgs) { const requestUrl = new URL(request.url) const code = requestUrl.searchParams.get('code') const next = requestUrl.searchParams.get('next') || '/' + const headers = new Headers() if (code) { const cookies = parse(request.headers.get('Cookie') ?? '') - const headers = new Headers() - const supabase = createServerClient(process.env.SUPABASE_URL!, process.env.SUPABASE_ANON_KEY!, { cookies: { get(key) {