Auth fix
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
import { AdvancedUrlFormCard } from "@/components/dashboard/advanced-url-form-card"
|
import { AdvancedUrlFormCard } from "@/components/dashboard/advanced-url-form-card"
|
||||||
|
import { getSession } from "@/lib/auth/session"
|
||||||
|
|
||||||
|
export default async function DashboardCreatePage() {
|
||||||
|
const { session, redirect } = await getSession()
|
||||||
|
|
||||||
|
if (!session) {
|
||||||
|
redirect("/sign-in")
|
||||||
|
}
|
||||||
|
|
||||||
export default function DashboardCreatePage() {
|
|
||||||
return (
|
return (
|
||||||
<div className="p-6 space-y-6">
|
<div className="p-6 space-y-6">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
import { UrlsDataTable } from "@/components/dashboard/urls-data-table"
|
import { UrlsDataTable } from "@/components/dashboard/urls-data-table"
|
||||||
|
import { getSession } from "@/lib/auth/session"
|
||||||
import { getAllUrls } from "@/lib/db/urls"
|
import { getAllUrls } from "@/lib/db/urls"
|
||||||
|
|
||||||
export default async function DashboardListPage() {
|
export default async function DashboardListPage() {
|
||||||
|
const { session, redirect } = await getSession()
|
||||||
|
|
||||||
|
if (!session) {
|
||||||
|
redirect("/sign-in")
|
||||||
|
}
|
||||||
|
|
||||||
const urls = await getAllUrls()
|
const urls = await getAllUrls()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user