Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ POSTGRES_DATABASE=

# Generate one here: https://generate-secret.vercel.app/32 (only required for localhost)
NEXTAUTH_SECRET=
# Solving local development jumping problems.
NEXTAUTH_URL=
5 changes: 3 additions & 2 deletions components/auth-status.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { unstable_getServerSession } from "next-auth/next";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";

export default async function AuthStatus() {
const session = await unstable_getServerSession();
const session = await getServerSession(authOptions);
return (
<div className="absolute top-5 w-full flex justify-center items-center">
{session && (
Expand Down
55 changes: 45 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 18 additions & 8 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
previewFeatures = ["jsonProtocol"]
}

datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
shadowDatabaseUrl = env("POSTGRES_URL_NON_POOLING") // used for migrations
}

model User {
id Int @id @default(autoincrement())
email String @unique
password String
}
id Int @id @default(autoincrement())
email String @unique
password String
Todo Todo[]
}

model Todo {
id Int @id @default(autoincrement())
createAt DateTime @default(now())
content String
done Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
}