Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Shift top level page redirect behaviour to next config

Joshen Lim445c1d3793e1
diff --git a/studio/next.config.js b/studio/next.config.js
index 0be76b8d5dd..aae6cd863b0 100644
--- a/studio/next.config.js
+++ b/studio/next.config.js
@@ -10,6 +10,30 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
const nextConfig = {
+ async redirects() {
+ return [
+ {
+ source: '/project/:ref/auth',
+ destination: '/project/:ref/auth/users',
+ permanent: true,
+ },
+ {
+ source: '/project/:ref/database',
+ destination: '/project/:ref/database/tables',
+ permanent: true,
+ },
+ {
+ source: '/project/:ref/storage',
+ destination: '/project/:ref/storage/buckets',
+ permanent: true,
+ },
+ {
+ source: '/project/:ref/settings',
+ destination: '/project/:ref/settings/general',
+ permanent: true,
+ },
+ ]
+ },
async headers() {
return [
{
@@ -55,6 +79,7 @@ const sentryWebpackPluginOptions = {
// Make sure adding Sentry options is the last code to run before exporting, to
// ensure that your source maps include changes from all other Webpack plugins
-module.exports = process.env.NEXT_PUBLIC_IS_PLATFORM === 'true'
- ? withSentryConfig(moduleExports, sentryWebpackPluginOptions)
- : nextConfig
+module.exports =
+ process.env.NEXT_PUBLIC_IS_PLATFORM === 'true'
+ ? withSentryConfig(moduleExports, sentryWebpackPluginOptions)
+ : nextConfig
diff --git a/studio/pages/project/[ref]/auth/index.tsx b/studio/pages/project/[ref]/auth/index.tsx
index d653c4f8ab7..6a5220f456e 100644
--- a/studio/pages/project/[ref]/auth/index.tsx
+++ b/studio/pages/project/[ref]/auth/index.tsx
@@ -1,18 +1,10 @@
-import { useEffect } from 'react'
import { NextPage } from 'next'
-import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { withAuth } from 'hooks'
import { AuthLayout } from 'components/layouts'
const Authentication: NextPage = () => {
- const router = useRouter()
-
- useEffect(() => {
- router.push(`${router.asPath}/users`)
- }, [])
-
return (
<AuthLayout title="Authentication">
<>{/* <h1>Use this as a template for authentication pages</h1> */}</>
diff --git a/studio/pages/project/[ref]/database/index.tsx b/studio/pages/project/[ref]/database/index.tsx
index b3546760e1a..067c304d6eb 100644
--- a/studio/pages/project/[ref]/database/index.tsx
+++ b/studio/pages/project/[ref]/database/index.tsx
@@ -1,18 +1,10 @@
-import { useEffect } from 'react'
import { NextPage } from 'next'
-import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { withAuth } from 'hooks'
import { DatabaseLayout } from 'components/layouts'
const Database: NextPage = () => {
- const router = useRouter()
-
- useEffect(() => {
- router.push(`${router.asPath}/tables`)
- }, [])
-
return (
<DatabaseLayout title="Database">
<>{/* <h1>Use this as a page template for database</h1> */}</>
diff --git a/studio/pages/project/[ref]/settings/index.tsx b/studio/pages/project/[ref]/settings/index.tsx
index ca32afc4e63..d264a9f1a7b 100644
--- a/studio/pages/project/[ref]/settings/index.tsx
+++ b/studio/pages/project/[ref]/settings/index.tsx
@@ -1,18 +1,10 @@
-import { useEffect } from 'react'
import { NextPage } from 'next'
-import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { withAuth } from 'hooks'
import { SettingsLayout } from 'components/layouts'
const Settings: NextPage = () => {
- const router = useRouter()
-
- useEffect(() => {
- router.push(`${router.asPath}/general`)
- }, [])
-
return (
<SettingsLayout>
<>{/* <h1>Use this as a page template for settings pages</h1> */}</>
diff --git a/studio/pages/project/[ref]/storage/index.tsx b/studio/pages/project/[ref]/storage/index.tsx
index d114b945017..8c416a36b32 100644
--- a/studio/pages/project/[ref]/storage/index.tsx
+++ b/studio/pages/project/[ref]/storage/index.tsx
@@ -1,18 +1,10 @@
-import { useEffect } from 'react'
import { NextPage } from 'next'
-import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { withAuth } from 'hooks'
import { StorageLayout } from 'components/layouts'
const Storage: NextPage = () => {
- const router = useRouter()
-
- useEffect(() => {
- router.push(`${router.asPath}/buckets`)
- }, [])
-
return (
<StorageLayout title="Storage">
<>{/* <h1>Use this as a template for storage pages</h1> */}</>