diff --git a/frontend/src/routes/(app)/dashboard/billing/plan/+page.server.ts b/frontend/src/routes/(app)/dashboard/billing/plan/+page.server.ts index 9d1e5a1..8e6a206 100644 --- a/frontend/src/routes/(app)/dashboard/billing/plan/+page.server.ts +++ b/frontend/src/routes/(app)/dashboard/billing/plan/+page.server.ts @@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit' import type { PageServerLoad } from './$types' export const load = (async () => { - redirect(301, '/dashboard/billing') + redirect(302, '/dashboard/billing') }) satisfies PageServerLoad diff --git a/frontend/src/routes/(app)/dashboard/billing/plan/pro/+page.server.ts b/frontend/src/routes/(app)/dashboard/billing/plan/pro/+page.server.ts index 9131fbe..af41f8a 100644 --- a/frontend/src/routes/(app)/dashboard/billing/plan/pro/+page.server.ts +++ b/frontend/src/routes/(app)/dashboard/billing/plan/pro/+page.server.ts @@ -8,10 +8,10 @@ import { eq } from 'drizzle-orm' export const load = (async (events) => { if (events.locals.user.plan !== 'free') { - redirect(301, '/dashboard/billing') + redirect(302, '/dashboard/billing') } if (!events.locals.user.email_verified) { - redirect(301, '/dashboard/billing') + redirect(302, '/dashboard/billing') } const user = events.locals.user @@ -47,8 +47,8 @@ export const load = (async (events) => { }) if (!session.url) { - redirect(301, '/dashboard/billing') + redirect(302, '/dashboard/billing') } - redirect(301, session.url) + redirect(302, session.url) }) satisfies PageServerLoad diff --git a/frontend/src/routes/(app)/dashboard/billing/plan/pro/success/+page.server.ts b/frontend/src/routes/(app)/dashboard/billing/plan/pro/success/+page.server.ts index 9e0cee2..ee66b93 100644 --- a/frontend/src/routes/(app)/dashboard/billing/plan/pro/success/+page.server.ts +++ b/frontend/src/routes/(app)/dashboard/billing/plan/pro/success/+page.server.ts @@ -10,14 +10,14 @@ export const load = (async ({ url }) => { const session_id = url.searchParams.get('session_id') const stripe = new Stripe(env.PRIVATE_STRIPE_SECRET_KEY) - if (!session_id) redirect(301, '/dashboard/billing') + if (!session_id) redirect(302, '/dashboard/billing') const session = await stripe.checkout.sessions.retrieve(session_id) if ( session.status === 'complete' && session.payment_status === 'paid' ) { - if (!session.customer) redirect(301, '/dashboard/billing') + if (!session.customer) redirect(302, '/dashboard/billing') await db .update(user) @@ -26,6 +26,6 @@ export const load = (async ({ url }) => { }) .where(eq(user.stripeCustomerId, session.customer?.toString())) - redirect(301, '/dashboard/billing') + redirect(302, '/dashboard/billing') } }) satisfies PageServerLoad diff --git a/frontend/src/routes/(auth)/signup/+page.server.ts b/frontend/src/routes/(auth)/signup/+page.server.ts index 9e0eb79..a7e7873 100644 --- a/frontend/src/routes/(auth)/signup/+page.server.ts +++ b/frontend/src/routes/(auth)/signup/+page.server.ts @@ -74,8 +74,7 @@ export const actions: Actions = { const redirectUrl = event.url.searchParams.get('redirect') if (redirectUrl) { - console.log(redirectUrl) - redirect(301, redirectUrl) + redirect(302, redirectUrl) } return { diff --git a/frontend/src/routes/(public)/url/[id]/qr/+page.server.ts b/frontend/src/routes/(public)/url/[id]/qr/+page.server.ts index 3d8ee5e..63546c7 100644 --- a/frontend/src/routes/(public)/url/[id]/qr/+page.server.ts +++ b/frontend/src/routes/(public)/url/[id]/qr/+page.server.ts @@ -18,7 +18,7 @@ export const load = (async (event) => { }) if (!shortener) { - redirect(301, `/dashboard/links`) + redirect(302, `/dashboard/links`) } let setting: { diff --git a/redirect/main.go b/redirect/main.go index b15d3e1..7013c31 100644 --- a/redirect/main.go +++ b/redirect/main.go @@ -105,7 +105,7 @@ func main() { invalidUrl := fallbackurl + "/qr/invalid" app.Get("/", func(c *fiber.Ctx) error { - return c.Redirect(fallbackurl) + return c.Redirect(fallbackurl, 301) }) app.Get("/:code", func(c *fiber.Ctx) error {