fix(auth): migrate from next-auth to better-auth (#1453)
This commit is contained in:
parent
453f5bb3e6
commit
b4f595a68c
40 changed files with 668 additions and 390 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { auth } from "@/app/(auth)/auth";
|
||||
import type { ArtifactKind } from "@/components/artifact";
|
||||
import { getSession } from "@/lib/auth";
|
||||
import {
|
||||
deleteDocumentsByIdAfterTimestamp,
|
||||
getDocumentsById,
|
||||
|
|
@ -18,7 +18,7 @@ export async function GET(request: Request) {
|
|||
).toResponse();
|
||||
}
|
||||
|
||||
const session = await auth();
|
||||
const session = await getSession();
|
||||
|
||||
if (!session?.user) {
|
||||
return new ChatbotError("unauthorized:document").toResponse();
|
||||
|
|
@ -50,7 +50,7 @@ export async function POST(request: Request) {
|
|||
).toResponse();
|
||||
}
|
||||
|
||||
const session = await auth();
|
||||
const session = await getSession();
|
||||
|
||||
if (!session?.user) {
|
||||
return new ChatbotError("not_found:document").toResponse();
|
||||
|
|
@ -103,7 +103,7 @@ export async function DELETE(request: Request) {
|
|||
).toResponse();
|
||||
}
|
||||
|
||||
const session = await auth();
|
||||
const session = await getSession();
|
||||
|
||||
if (!session?.user) {
|
||||
return new ChatbotError("unauthorized:document").toResponse();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue