summaryrefslogtreecommitdiff
path: root/src/pages/login.tsx
blob: 13d3bd49ffd6e944a0c2f135c97ae6a724ab740a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import AuthScreen from "@/components/Login2";
import ProfileScreen from "@/components/Profile";
import { Link } from "waku";
import db from "@/lib/db";
import { getContextData } from "waku/middleware/context";

export default async function AuthPage() {
  const ctx = getContextData();
  console.log({ ctx });
  const data = await getData();
  if (ctx.user) return <ProfileScreen user={ctx.user as any} />;
  else
    return (
      <div>
        <AuthScreen />
      </div>
    );
}

const getData = async () => {
  // const data = {
  //   title: "Waku",
  //   headline: "Waku",
  //   body: "Hello world!",
  // };
  // return data;
};

export const getConfig = async () => {
  return {
    render: "static",
  } as const;
};