Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Commit 59ea6e8

Browse files
committed
fix: create supabase client server side each time for sitemap routes
1 parent 25da472 commit 59ea6e8

11 files changed

Lines changed: 33 additions & 22 deletions

File tree

src/app/sitemaps/(films)/films.xml/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET() {
5-
const { data, error } = await supabaseAdmin.storage
5+
const supabase = await createClient();
6+
const { data, error } = await supabase.storage
67
.from("sitemaps")
78
.download("movies/index.xml.gz");
89

src/app/sitemaps/(films)/films/[id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET(
55
_: Request,
66
{ params }: { params: Promise<{ id: string }> }
77
) {
8+
const supabase = await createClient();
89
const { id } = await params;
9-
const { data, error } = await supabaseAdmin.storage
10+
const { data, error } = await supabase.storage
1011
.from("sitemaps")
1112
.download(`movies/${id}.xml.gz`);
1213
if (error || !data) {

src/app/sitemaps/(playlists)/playlists.xml/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET() {
5-
const { data, error } = await supabaseAdmin.storage
5+
const supabase = await createClient();
6+
const { data, error } = await supabase.storage
67
.from("sitemaps")
78
.download("playlists/index.xml.gz");
89

src/app/sitemaps/(playlists)/playlists/[id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET(
55
_: Request,
66
{ params }: { params: Promise<{ id: string }> }
77
) {
8+
const supabase = await createClient();
89
const { id } = await params;
9-
const { data, error } = await supabaseAdmin.storage
10+
const { data, error } = await supabase.storage
1011
.from("sitemaps")
1112
.download(`playlists/${id}.xml.gz`);
1213
if (error || !data) {

src/app/sitemaps/(reviews)/reviews.xml/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET() {
5-
const { data, error } = await supabaseAdmin.storage
5+
const supabase = await createClient();
6+
const { data, error } = await supabase.storage
67
.from("sitemaps")
78
.download("reviews/index.xml.gz");
89

src/app/sitemaps/(reviews)/reviews/movie/[id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET(
55
_: Request,
66
{ params }: { params: Promise<{ id: string }> }
77
) {
8+
const supabase = await createClient();
89
const { id } = await params;
9-
const { data, error } = await supabaseAdmin.storage
10+
const { data, error } = await supabase.storage
1011
.from("sitemaps")
1112
.download(`reviews/movie/${id}.xml.gz`);
1213
if (error || !data) {

src/app/sitemaps/(reviews)/reviews/tv-series/[id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET(
55
_: Request,
66
{ params }: { params: Promise<{ id: string }> }
77
) {
8+
const supabase = await createClient();
89
const { id } = await params;
9-
const { data, error } = await supabaseAdmin.storage
10+
const { data, error } = await supabase.storage
1011
.from("sitemaps")
1112
.download(`reviews/tv-series/${id}.xml.gz`);
1213
if (error || !data) {

src/app/sitemaps/(tv-series)/tv-series.xml/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET() {
5-
const { data, error } = await supabaseAdmin.storage
5+
const supabase = await createClient();
6+
const { data, error } = await supabase.storage
67
.from("sitemaps")
78
.download("tv-series/index.xml.gz");
89

src/app/sitemaps/(tv-series)/tv-series/[id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET(
55
_: Request,
66
{ params }: { params: Promise<{ id: string }> }
77
) {
8+
const supabase = await createClient();
89
const { id } = await params;
9-
const { data, error } = await supabaseAdmin.storage
10+
const { data, error } = await supabase.storage
1011
.from("sitemaps")
1112
.download(`tv-series/${id}.xml.gz`);
1213
if (error || !data) {

src/app/sitemaps/(users)/users.xml/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { supabaseAdmin } from "@/lib/supabase/supabase-admin";
1+
import { createClient } from "@/lib/supabase/server-no-cookie";
22
import { NextResponse } from "next/server";
33

44
export async function GET() {
5-
const { data, error } = await supabaseAdmin.storage
5+
const supabase = await createClient();
6+
const { data, error } = await supabase.storage
67
.from("sitemaps")
78
.download("users/index.xml.gz");
89

0 commit comments

Comments
 (0)