Added middleware and session helper
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import { OAuthSignInButton } from "@/components/auth/signin-button"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { auth } from "@/lib/auth/auth"
|
||||
import { getSession } from "@/lib/auth/session"
|
||||
import { LogIn } from "lucide-react"
|
||||
import { headers } from "next/headers"
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
export default async function SignInPage() {
|
||||
const session = await auth.api.getSession({
|
||||
headers: await headers()
|
||||
})
|
||||
const { session, redirect } = await getSession()
|
||||
|
||||
if (session) {
|
||||
redirect("/")
|
||||
redirect("/dashboard")
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 p-4">
|
||||
<Card className="w-full max-w-md shadow-xl">
|
||||
|
||||
Reference in New Issue
Block a user