Skip to content

Commit

Permalink
Workaround Error: The "host" request header is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Apr 29, 2023
1 parent be909c9 commit 3670133
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/web/server/server-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ export async function serverGetViewer(
headers: () => ({get: () => undefined}),
cookies: () => ({get: () => undefined}),
...context,
// Workaround for https://github.com/supabase/auth-helpers/issues/341#issuecomment-1528696953
// Setting cookie is not supported inside server components anyways.
// @see https://github.com/supabase/auth-helpers/blob/main/packages/shared/src/supabase-server.ts#L68
cookieOptions: {secure: true},
})

const {data: sessionRes} = await supabase.auth.getSession()
Expand Down

0 comments on commit 3670133

Please sign in to comment.