feat(setup): add initial setup wizard for admin account and SMTP configuration
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import { LoginForm } from "@/components/login-form";
|
||||
import { isSetupNeeded } from "@/lib/actions/setup";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Page() {
|
||||
if (await isSetupNeeded()) {
|
||||
redirect("/setup");
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="flex min-h-svh w-full items-center justify-center p-6 md:p-10">
|
||||
<div className="w-full max-w-sm">
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { HomeClient } from '@/components/HomeClient'
|
||||
import { isSetupNeeded } from '@/lib/actions/setup'
|
||||
import { redirect } from 'next/navigation'
|
||||
|
||||
export const dynamic = "force-dynamic"
|
||||
|
||||
export default async function Home() {
|
||||
if (await isSetupNeeded()) {
|
||||
redirect('/setup')
|
||||
}
|
||||
|
||||
let user = null
|
||||
try {
|
||||
const supabase = await createClient()
|
||||
|
||||
15
shop/app/setup/page.tsx
Normal file
15
shop/app/setup/page.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { isSetupNeeded } from '@/lib/actions/setup'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { SetupWizard } from '@/components/SetupWizard'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export default async function SetupPage() {
|
||||
const needed = await isSetupNeeded()
|
||||
|
||||
if (!needed) {
|
||||
redirect('/')
|
||||
}
|
||||
|
||||
return <SetupWizard />
|
||||
}
|
||||
Reference in New Issue
Block a user