feat: edge ready
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Image from "next/image";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { getServerAuthSession } from "~/server/auth";
|
||||
import { auth } from "~/server/auth";
|
||||
|
||||
import boardsIcon from "~/app/assets/boards.json";
|
||||
|
||||
@@ -12,7 +12,7 @@ const navigation = [
|
||||
];
|
||||
|
||||
export default async function Layout(props: { children: React.ReactNode }) {
|
||||
const session = await getServerAuthSession();
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user) redirect("api/auth/signin");
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import NextAuth from "next-auth";
|
||||
export { GET, POST } from "~/server/auth";
|
||||
|
||||
import { authOptions } from "~/server/auth";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const handler = NextAuth(authOptions);
|
||||
export { handler as GET, handler as POST };
|
||||
|
||||
// export const runtime = "edge";
|
||||
// export const preferredRegion = 'lhr1';
|
||||
// export const dynamic = 'force-dynamic'
|
||||
export const runtime = "edge";
|
||||
export const preferredRegion = 'lhr1';
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
@@ -23,6 +23,6 @@ const handler = (req: NextRequest) =>
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
|
||||
// export const runtime = "edge";
|
||||
// export const preferredRegion = 'lhr1';
|
||||
// export const dynamic = 'force-dynamic'
|
||||
export const runtime = "edge";
|
||||
export const preferredRegion = 'lhr1';
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
@@ -2,17 +2,17 @@ import { Login } from "~/app/_components/auth";
|
||||
|
||||
export default function LoginPage() {
|
||||
return (
|
||||
<main className="bg-dark-50 flex h-screen flex-col items-center justify-center">
|
||||
<h1 className="text-dark-1000 mb-6 text-lg font-normal tracking-tight">
|
||||
<main className="flex h-screen flex-col items-center justify-center bg-dark-50">
|
||||
<h1 className="mb-6 text-lg font-normal tracking-tight text-dark-1000">
|
||||
貫 kan
|
||||
</h1>
|
||||
<p className="text-dark-1000 mb-10 text-3xl">Get started</p>
|
||||
<div className="bg-dark-400 border-dark-600 w-full rounded-md border px-10 py-10 sm:max-w-md">
|
||||
<p className="mb-10 text-3xl text-dark-1000">Get started</p>
|
||||
<div className="w-full rounded-md border border-dark-600 bg-dark-300 px-10 py-10 sm:max-w-md">
|
||||
<div className=" sm:mx-auto sm:w-full sm:max-w-sm">
|
||||
<Login />
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-dark-1000 mt-10 text-center text-sm">
|
||||
<p className="mt-10 text-center text-sm text-dark-1000">
|
||||
{"Already have an account?"}
|
||||
</p>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user