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,15 +1,15 @@
|
|||
import { tool, type UIMessageStreamWriter } from "ai";
|
||||
import type { Session } from "next-auth";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
artifactKinds,
|
||||
documentHandlersByArtifactKind,
|
||||
} from "@/lib/artifacts/server";
|
||||
import type { AuthSession } from "@/lib/auth";
|
||||
import type { ChatMessage } from "@/lib/types";
|
||||
import { generateUUID } from "@/lib/utils";
|
||||
|
||||
type CreateDocumentProps = {
|
||||
session: Session;
|
||||
session: NonNullable<AuthSession>;
|
||||
dataStream: UIMessageStreamWriter<ChatMessage>;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Output, streamText, tool, type UIMessageStreamWriter } from "ai";
|
||||
import type { Session } from "next-auth";
|
||||
import { z } from "zod";
|
||||
import type { AuthSession } from "@/lib/auth";
|
||||
import { getDocumentById, saveSuggestions } from "@/lib/db/queries";
|
||||
import type { Suggestion } from "@/lib/db/schema";
|
||||
import type { ChatMessage } from "@/lib/types";
|
||||
|
|
@ -8,7 +8,7 @@ import { generateUUID } from "@/lib/utils";
|
|||
import { getArtifactModel } from "../providers";
|
||||
|
||||
type RequestSuggestionsProps = {
|
||||
session: Session;
|
||||
session: NonNullable<AuthSession>;
|
||||
dataStream: UIMessageStreamWriter<ChatMessage>;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { tool, type UIMessageStreamWriter } from "ai";
|
||||
import type { Session } from "next-auth";
|
||||
import { z } from "zod";
|
||||
import { documentHandlersByArtifactKind } from "@/lib/artifacts/server";
|
||||
import type { AuthSession } from "@/lib/auth";
|
||||
import { getDocumentById } from "@/lib/db/queries";
|
||||
import type { ChatMessage } from "@/lib/types";
|
||||
|
||||
type UpdateDocumentProps = {
|
||||
session: Session;
|
||||
session: NonNullable<AuthSession>;
|
||||
dataStream: UIMessageStreamWriter<ChatMessage>;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue