Skip to content

Commit

Permalink
Merge pull request #207 from olivorocksrotated/chore/migrate-to-nexta…
Browse files Browse the repository at this point in the history
…uth-5

Chore/migrate to nextauth 5
  • Loading branch information
lean1190 authored Dec 30, 2023
2 parents 3c8872a + 73b628b commit d4d8c7e
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 138 deletions.
204 changes: 112 additions & 92 deletions package-lock.json

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

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"test:integration": "cypress run --component --quiet",
"lint": "next lint",
"lint:fix": "next lint --fix",
"vercel-build": "prisma generate && next build",
"vercel-build": "prisma generate --no-engine && next build",
"db:login": "pscale auth login",
"db:connect": "CURRENT_BRANCH=$(eval 'git branch --show-current | cut -f2- -d/'); pscale connect olivo ${npm_config_branch:-$CURRENT_BRANCH} --port 3310",
"db:ls": "pscale branch list olivo",
"db:gui": "prisma studio",
"db:start-change": "CURRENT_BRANCH=$(eval 'git branch --show-current | cut -f2- -d/'); pscale branch create olivo ${npm_config_branch:-$CURRENT_BRANCH}",
"db:apply-change": "prisma generate",
"db:apply-change": "prisma generate --no-engine",
"db:push-change": "prisma db push",
"db:finish-change": "CURRENT_BRANCH=$(eval 'git branch --show-current | cut -f2- -d/'); pscale branch delete olivo ${npm_config_branch:-$CURRENT_BRANCH}",
"events:dev": "npx inngest-cli@latest dev -u http://localhost:3000/api/inngest",
Expand All @@ -34,9 +34,11 @@
"prepare": "husky install"
},
"dependencies": {
"@auth/core": "^0.19.0",
"@auth/prisma-adapter": "^1.0.12",
"@formkit/auto-animate": "^1.0.0-beta.6",
"@next-auth/prisma-adapter": "^1.0.7",
"@prisma/client": "^5.7.1",
"@prisma/extension-accelerate": "^0.6.2",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-popover": "^1.0.7",
Expand All @@ -63,7 +65,7 @@
"framer-motion": "^10.16.16",
"inngest": "^3.7.4",
"next": "14.0.4",
"next-auth": "^4.24.5",
"next-auth": "^5.0.0-beta.4",
"next-safe-action": "^5.2.3",
"openai-edge": "^1.2.2",
"react": "^18.2.0",
Expand Down
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ generator client {
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_DATABASE_URL")
relationMode = "prisma"
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/api/ai/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { getServerSession } from '@/lib/auth/session';
import { createOvercommitmentPrompt } from '@/lib/commitments/ai';
import { createMoodAdvicePrompt, createMoodSummaryPrompt } from '@/lib/moods/ai';

export const runtime = 'edge';

const executionPrompt: { [key in AiExecutionName]: (userId: string) => Promise<string> } = {
[AiExecutionName.MoodSummary]: createMoodSummaryPrompt,
[AiExecutionName.MoodAdvice]: createMoodAdvicePrompt,
Expand Down
7 changes: 1 addition & 6 deletions src/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
import NextAuth from 'next-auth';

import { authOptions } from '@/config/auth';

const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };
export { GET, POST } from '../../../../config/auth';
Loading

1 comment on commit d4d8c7e

@vercel
Copy link

@vercel vercel bot commented on d4d8c7e Dec 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.