mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
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.
This commit is contained in:
1 parent
4bca7baf15
commit
67a840915d
1 file changed
+1
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user