chore(package): update package.json engines to node 24.x

This commit is contained in:
Fatih Kadir Akın
2025-12-20 19:35:27 +03:00
parent d8f994ee32
commit a2c314701d
28 changed files with 65 additions and 46 deletions

36
package-lock.json generated
View File

@@ -1038,6 +1038,7 @@
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.28.5",
@@ -3175,6 +3176,7 @@
"integrity": "sha512-4SXj4Oo6HyQkLUWT8Ke5R0PTAfVOKip5Roo+6+b2EDTkFg5be0FnBWiuRJc0BC0sRQIWGMLKW1XguhVfW/z3/A==",
"hasInstallScript": true,
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": ">=18.18"
},
@@ -5846,6 +5848,7 @@
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz",
"integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==",
"license": "MIT",
"peer": true,
"dependencies": {
"csstype": "^3.2.2"
}
@@ -5856,6 +5859,7 @@
"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
"devOptional": true,
"license": "MIT",
"peer": true,
"peerDependencies": {
"@types/react": "^19.2.0"
}
@@ -5865,8 +5869,7 @@
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
"license": "MIT",
"optional": true,
"peer": true
"optional": true
},
"node_modules/@types/unist": {
"version": "3.0.3",
@@ -5919,6 +5922,7 @@
"integrity": "sha512-6/cmF2piao+f6wSxUsJLZjck7OQsYyRtcOZS02k7XINSNlz93v6emM8WutDQSXnroG2xwYlEVHJI+cPA7CPM3Q==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.50.0",
"@typescript-eslint/types": "8.50.0",
@@ -6437,6 +6441,7 @@
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -6760,6 +6765,7 @@
"integrity": "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==",
"devOptional": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/types": "^7.26.0"
}
@@ -6873,6 +6879,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -7532,7 +7539,6 @@
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.7.tgz",
"integrity": "sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==",
"license": "(MPL-2.0 OR Apache-2.0)",
"peer": true,
"optionalDependencies": {
"@types/trusted-types": "^2.0.7"
}
@@ -7879,6 +7885,7 @@
"integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@@ -8064,6 +8071,7 @@
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@rtsao/scc": "^1.1.0",
"array-includes": "^3.1.9",
@@ -8366,6 +8374,7 @@
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
"license": "MIT",
"peer": true,
"dependencies": {
"accepts": "^2.0.0",
"body-parser": "^2.2.1",
@@ -10192,7 +10201,6 @@
"resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz",
"integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==",
"license": "MIT",
"peer": true,
"bin": {
"marked": "bin/marked.js"
},
@@ -10968,6 +10976,7 @@
"resolved": "https://registry.npmjs.org/next/-/next-16.0.10.tgz",
"integrity": "sha512-RtWh5PUgI+vxlV3HdR+IfWA1UUHu0+Ram/JBO4vWB54cVPentCD0e+lxyAYEsDTqGGMg7qpjhKh6dc6aW7W/sA==",
"license": "MIT",
"peer": true,
"dependencies": {
"@next/env": "16.0.10",
"@swc/helpers": "0.5.15",
@@ -11146,17 +11155,6 @@
}
}
},
"node_modules/next-intl/node_modules/@swc/helpers": {
"version": "0.5.17",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz",
"integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==",
"license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": {
"tslib": "^2.8.0"
}
},
"node_modules/next-themes": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz",
@@ -12133,6 +12131,7 @@
"resolved": "https://registry.npmjs.org/preact/-/preact-10.24.3.tgz",
"integrity": "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==",
"license": "MIT",
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
@@ -12164,6 +12163,7 @@
"devOptional": true,
"hasInstallScript": true,
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@prisma/config": "6.19.1",
"@prisma/engines": "6.19.1"
@@ -12343,6 +12343,7 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz",
"integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -12352,6 +12353,7 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz",
"integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"scheduler": "^0.27.0"
},
@@ -12364,6 +12366,7 @@
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.68.0.tgz",
"integrity": "sha512-oNN3fjrZ/Xo40SWlHf1yCjlMK417JxoSJVUXQjGdvdRCU07NTFei1i1f8ApUAts+IVh14e4EdakeLEA+BEAs/Q==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18.0.0"
},
@@ -13421,6 +13424,7 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@@ -13655,6 +13659,7 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"devOptional": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -14148,6 +14153,7 @@
"resolved": "https://registry.npmjs.org/zod/-/zod-4.2.1.tgz",
"integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==",
"license": "MIT",
"peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}

View File

@@ -78,5 +78,8 @@
"tsx": "^4.21.0",
"tw-animate-css": "^1.4.0",
"typescript": "^5"
},
"engines": {
"node": "24.x"
}
}

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-require-imports */
const fs = require('fs');
const path = require('path');

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-require-imports */
/**
* Interactive setup script for private prompts.chat clones.

View File

@@ -12,7 +12,6 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Card, CardContent } from "@/components/ui/card";
import { PromptList } from "@/components/prompts/prompt-list";
import { PromptCard, type PromptCardProps } from "@/components/prompts/prompt-card";
import { McpServerPopup } from "@/components/mcp/mcp-server-popup";

View File

@@ -5,7 +5,7 @@ import { auth } from "@/lib/auth";
import { db } from "@/lib/db";
import { Prisma } from "@prisma/client";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Users, FolderTree, Tags, FileText, Webhook, Flag } from "lucide-react";
import { UsersTable } from "@/components/admin/users-table";
import { CategoriesTable } from "@/components/admin/categories-table";

View File

@@ -295,6 +295,7 @@ export async function GET(request: Request) {
}
// Build order by clause
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let orderBy: any = { createdAt: "desc" };
if (sort === "oldest") {
orderBy = { createdAt: "asc" };

View File

@@ -564,7 +564,7 @@ export default function SelfHostingPage() {
<li>Hide &quot;Clone on GitHub&quot; button</li>
</ul>
<div className="bg-muted rounded-lg p-4 font-mono text-sm">
<p className="text-muted-foreground">// prompts.config.ts</p>
<p className="text-muted-foreground">{"// prompts.config.ts"}</p>
<p>const useCloneBranding = true;</p>
</div>
</div>

View File

@@ -3,7 +3,7 @@ import { notFound } from "next/navigation";
import Link from "next/link";
import { getTranslations, getLocale } from "next-intl/server";
import { formatDistanceToNow } from "@/lib/date";
import { Calendar, Clock, Copy, Share2, Edit, History, GitPullRequest, Check, X, Users, ImageIcon, Video, FileText, Shield } from "lucide-react";
import { Calendar, Clock, Edit, History, GitPullRequest, Check, X, Users, ImageIcon, Video, FileText, Shield } from "lucide-react";
import { ShareDropdown } from "@/components/prompts/share-dropdown";
import { auth } from "@/lib/auth";
import { db } from "@/lib/db";

View File

@@ -7,7 +7,7 @@ import { InfinitePromptList } from "@/components/prompts/infinite-prompt-list";
import { PromptFilters } from "@/components/prompts/prompt-filters";
import { FilterProvider } from "@/components/prompts/filter-context";
import { HFDataStudioDropdown } from "@/components/prompts/hf-data-studio-dropdown";
import { McpServerPopup, McpIcon } from "@/components/mcp/mcp-server-popup";
import { McpServerPopup } from "@/components/mcp/mcp-server-popup";
import { db } from "@/lib/db";
import { isAISearchEnabled, semanticSearch } from "@/lib/ai/embeddings";
import { isAIGenerationEnabled } from "@/lib/ai/generation";
@@ -122,6 +122,7 @@ export default async function PromptsPage({ searchParams }: PromptsPageProps) {
const aiGenerationAvailable = await isAIGenerationEnabled();
const useAISearch = aiSearchAvailable && params.ai === "1" && params.q;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let prompts: any[] = [];
let total = 0;
@@ -176,6 +177,7 @@ export default async function PromptsPage({ searchParams }: PromptsPageProps) {
// Build order by clause
const isUpvoteSort = params.sort === "upvotes";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let orderBy: any = { createdAt: "desc" };
if (params.sort === "oldest") {
orderBy = { createdAt: "asc" };

View File

@@ -6,7 +6,6 @@ import { useTranslations } from "next-intl";
import Link from "next/link";
import { Upload, Trash2, Loader2, CheckCircle, AlertCircle, Sparkles, Download, RefreshCw, Link2, Search, ExternalLink, Eye, EyeOff, Star, Flag, ChevronLeft, ChevronRight, Filter } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Progress } from "@/components/ui/progress";
import { Input } from "@/components/ui/input";
import { Badge } from "@/components/ui/badge";

View File

@@ -3,7 +3,6 @@
import { useState } from "react";
import { useRouter } from "next/navigation";
import { useTranslations } from "next-intl";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
@@ -13,7 +12,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
import { Plus, MoreHorizontal, Pencil, Trash2, Webhook, Slack, X, Play } from "lucide-react";
import { Plus, MoreHorizontal, Pencil, Trash2, Slack, X, Play } from "lucide-react";
import { SLACK_PRESET_PAYLOAD, WEBHOOK_PLACEHOLDERS } from "@/lib/webhook";
import { CodeEditor } from "@/components/ui/code-editor";

View File

@@ -103,7 +103,7 @@ export function CommentItem({
isAdmin,
isLoggedIn,
locale,
replies,
replies: _replies,
allComments,
onCommentAdded,
onCommentDeleted,

View File

@@ -43,7 +43,7 @@ import {
import { NotificationBell } from "@/components/layout/notification-bell";
import { setLocale } from "@/lib/i18n/client";
import { useBranding } from "@/components/providers/branding-provider";
import { analyticsAuth, analyticsNav, analyticsSettings } from "@/lib/analytics";
import { analyticsAuth, analyticsSettings } from "@/lib/analytics";
const languages = [
{ code: "en", name: "English" },
@@ -69,8 +69,6 @@ interface HeaderProps {
export function Header({ authProvider = "credentials", allowRegistration = true }: HeaderProps) {
const isOAuth = authProvider !== "credentials";
// Show register button for OAuth (with login text) or credentials with registration enabled
const showRegisterButton = isOAuth || (authProvider === "credentials" && allowRegistration);
const { data: session } = useSession();
const t = useTranslations();
const { theme, setTheme } = useTheme();

View File

@@ -3,7 +3,7 @@
import { useState, useRef } from "react";
import { useRouter } from "next/navigation";
import { useTranslations } from "next-intl";
import { Loader2, Eye, Edit3, GitCompare } from "lucide-react";
import { Loader2, Edit3, GitCompare } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Textarea } from "@/components/ui/textarea";
import { Input } from "@/components/ui/input";

View File

@@ -2,7 +2,7 @@
import { useState } from "react";
import { useTranslations } from "next-intl";
import { Download, FileText, FileCode, Copy, Check, Link } from "lucide-react";
import { Download, FileText, FileCode, Check, Link } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,

View File

@@ -56,8 +56,11 @@ export function HeroPromptInput() {
setDisplayText((prev) => prev.slice(0, -1));
}, DELETE_SPEED);
} else {
setIsDeleting(false);
setCurrentPromptIndex((prev) => (prev + 1) % examplePrompts.length);
// Schedule state updates to avoid synchronous setState in effect
animationRef.current = setTimeout(() => {
setIsDeleting(false);
setCurrentPromptIndex((prev) => (prev + 1) % examplePrompts.length);
}, 0);
}
} else {
if (displayText.length < currentPrompt.length) {

View File

@@ -6,7 +6,6 @@ import { useTheme } from "next-themes";
import { ChevronDown, Play, ExternalLink, Sparkles, Loader2 } from "lucide-react";
import Editor from "@monaco-editor/react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import {
Popover,
PopoverContent,

View File

@@ -49,7 +49,7 @@ export function InfinitePromptList({
filters
}: InfinitePromptListProps) {
const t = useTranslations("prompts");
const searchParams = useSearchParams();
const _searchParams = useSearchParams();
const { isFilterPending, setFilterPending } = useFilterContext();
const [prompts, setPrompts] = useState(initialPrompts);
const [page, setPage] = useState(1);

View File

@@ -78,10 +78,11 @@ function EditableSpan({
if (!value && !document.activeElement?.isSameNode(spanRef.current)) {
// Show placeholder when empty and not focused
spanRef.current.textContent = placeholder;
setIsShowingPlaceholder(true);
// Sync state with DOM - intentional pattern
queueMicrotask(() => setIsShowingPlaceholder(true));
} else if (value && spanRef.current.textContent !== value) {
spanRef.current.textContent = value;
setIsShowingPlaceholder(false);
queueMicrotask(() => setIsShowingPlaceholder(false));
}
}
}, [value, placeholder]);

View File

@@ -17,7 +17,8 @@ export function PrivatePromptsNote({ count }: PrivatePromptsNoteProps) {
useEffect(() => {
const dismissed = localStorage.getItem(STORAGE_KEY) === "true";
setIsDismissed(dismissed);
// Read from localStorage on mount - use queueMicrotask to avoid sync setState
queueMicrotask(() => setIsDismissed(dismissed));
}, []);
const handleDismiss = () => {

View File

@@ -166,8 +166,8 @@ export const PromptBuilder = forwardRef<PromptBuilderHandle, PromptBuilderProps>
}
let fullContent = "";
let toolCalls: ToolCall[] = [];
let searchResults: Message["searchResults"] = [];
const toolCalls: ToolCall[] = [];
const searchResults: Message["searchResults"] = [];
let newState: PromptBuilderState | null = null;
while (true) {

View File

@@ -739,6 +739,7 @@ export function PromptForm({ categories, tags, initialData, initialContributors
</SelectContent>
</Select>
{isStructuredInput && (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
<Select value={structuredFormat || "JSON"} onValueChange={(v) => form.setValue("structuredFormat", v as any)}>
<SelectTrigger className="h-9 w-24">
<SelectValue />

View File

@@ -340,8 +340,8 @@ export function RunPromptButton({
);
};
// Tab buttons component
const TabButtons = ({ size = "default" }: { size?: "default" | "small" }) => (
// Tab buttons render function
const renderTabButtons = (size: "default" | "small" = "default") => (
<div className={`flex gap-1 ${size === "small" ? "p-1" : "p-1.5"} bg-muted rounded-md`}>
<button
onClick={() => setActiveTab("chat")}
@@ -382,7 +382,7 @@ export function RunPromptButton({
<SheetTitle>{t("run")}</SheetTitle>
</SheetHeader>
<div className="py-2">
<TabButtons />
{renderTabButtons()}
</div>
<div className="overflow-y-auto flex-1 py-2">
{activePlatforms.map(renderMobilePlatform)}
@@ -400,7 +400,7 @@ export function RunPromptButton({
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-52">
<div className="p-1">
<TabButtons size="small" />
{renderTabButtons("small")}
</div>
<DropdownMenuSeparator />
<div className="max-h-64 overflow-y-auto">

View File

@@ -31,7 +31,8 @@ export function VariableToolbar({ onInsert, getSelectedText }: VariableToolbarPr
// Sanitize: lowercase, replace spaces with underscores, remove invalid chars
const sanitized = selected.trim().toLowerCase().replace(/\s+/g, "_").replace(/[^a-z0-9_]/g, "");
if (sanitized) {
setName(sanitized);
// Use queueMicrotask to avoid sync setState in effect
queueMicrotask(() => setName(sanitized));
}
}
}

View File

@@ -163,8 +163,8 @@ function CodeDiffContent({ wordDiff, language }: { wordDiff: WordDiff[]; languag
let hasDeletion = false;
// Check what diffs overlap with this line
let lineStart = charIndex;
let lineEnd = charIndex + lineText.length;
const lineStart = charIndex;
const lineEnd = charIndex + lineText.length;
let pos = 0;
for (const diff of wordDiff) {

View File

@@ -247,7 +247,7 @@ export async function executeToolCall(
availableTags: Array<{ id: string; name: string; slug: string; color: string }>,
availableCategories: Array<{ id: string; name: string; slug: string; parentId: string | null }>
): Promise<{ result: ToolResult; newState: PromptBuilderState }> {
let newState = { ...currentState };
const newState = { ...currentState };
switch (toolName) {
case "search_prompts": {

View File

@@ -43,7 +43,9 @@ function CustomPrismaAdapter(): Adapter {
...prismaAdapter,
async createUser(data: AdapterUser & { username?: string; githubUsername?: string }) {
// Use GitHub username if provided, otherwise generate one
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let username = (data as any).username;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const githubUsername = (data as any).githubUsername; // Immutable GitHub username
if (!username) {
@@ -152,6 +154,7 @@ async function buildAuthConfig() {
error: "/login",
},
callbacks: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async jwt({ token, user, trigger }: { token: any; user?: any; trigger?: string }) {
// On sign in, look up the actual database user by email to ensure correct ID
if (user && user.email) {
@@ -194,6 +197,7 @@ async function buildAuthConfig() {
return token;
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async session({ session, token }: { session: any; token: any }) {
// If token is null/invalid, return empty session
if (!token) {