mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-25 16:36:34 -05:00
docs: fix typo & unresolved imports (#7954)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
import { cva } from "class-variance-authority";
|
||||
import { useEffectEvent } from "fumadocs-core/utils/use-effect-event";
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
@@ -14,7 +13,13 @@ import {
|
||||
MessageCircle,
|
||||
} from "lucide-react";
|
||||
import type { MouseEventHandler } from "react";
|
||||
import { useEffect, useRef, useState, useTransition } from "react";
|
||||
import {
|
||||
useEffect,
|
||||
useEffectEvent,
|
||||
useRef,
|
||||
useState,
|
||||
useTransition,
|
||||
} from "react";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import * as Primitive from "fumadocs-core/toc";
|
||||
import { useEffectEvent } from "fumadocs-core/utils/use-effect-event";
|
||||
import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
||||
import type { HTMLAttributes, RefObject } from "react";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useEffect, useEffectEvent, useRef } from "react";
|
||||
|
||||
export type TOCThumb = [top: number, height: number];
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import { cva } from "class-variance-authority";
|
||||
import type { BreadcrumbOptions } from "fumadocs-core/breadcrumb";
|
||||
import { getBreadcrumbItemsFromPath } from "fumadocs-core/breadcrumb";
|
||||
import type { Item, Node, Root } from "fumadocs-core/page-tree";
|
||||
import { useEffectEvent } from "fumadocs-core/utils/use-effect-event";
|
||||
import { useSidebar } from "fumadocs-ui/components/sidebar/base";
|
||||
import { useI18n } from "fumadocs-ui/contexts/i18n";
|
||||
import { useTreeContext, useTreePath } from "fumadocs-ui/contexts/tree";
|
||||
@@ -12,7 +11,14 @@ import { ChevronLeft, ChevronRight } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import type { HTMLAttributes } from "react";
|
||||
import { Fragment, useEffect, useMemo, useRef, useState } from "react";
|
||||
import {
|
||||
Fragment,
|
||||
useEffect,
|
||||
useEffectEvent,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { isActive } from "../../lib/is-active";
|
||||
import { cn } from "../../lib/utils";
|
||||
import { useNav } from "./layout/nav";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"use client";
|
||||
import { useEffectEvent } from "fumadocs-core/utils/use-effect-event";
|
||||
import type { MouseEventHandler } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useEffect, useEffectEvent, useRef, useState } from "react";
|
||||
|
||||
export function useCopyButton(
|
||||
onCopy: () => void | Promise<void>,
|
||||
|
||||
@@ -318,7 +318,7 @@ const auth = betterAuth({
|
||||
|
||||
### Disable Is Username Available
|
||||
|
||||
By default, the plugin exposes an endpoint `/is-username-available` to check if a username is available. You can disable this endpoint by providing `disablePaths` option to the better-auth configuration. This is useful if you want to protect usernames from being enumerated.
|
||||
By default, the plugin exposes an endpoint `/is-username-available` to check if a username is available. You can disable this endpoint by providing `disabledPaths` option to the better-auth configuration. This is useful if you want to protect usernames from being enumerated.
|
||||
|
||||
```ts title="auth.ts"
|
||||
import { betterAuth } from "better-auth"
|
||||
@@ -328,7 +328,7 @@ const auth = betterAuth({
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
},
|
||||
disablePaths: ["/is-username-available"],
|
||||
disabledPaths: ["/is-username-available"],
|
||||
plugins: [
|
||||
username()
|
||||
]
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
import { join } from "node:path";
|
||||
import { createMDX } from "fumadocs-mdx/next";
|
||||
|
||||
const withMDX = createMDX();
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const config = {
|
||||
...(process.env.NODE_ENV === "development"
|
||||
? {
|
||||
turbopack: {
|
||||
root: join(import.meta.dirname, ".."),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user