SolidStart 集成

在开始之前,请确保您已配置好 Better Auth 实例。如果尚未完成,请查看安装指南

挂载处理器

我们需要将处理器挂载到 SolidStart 服务器。将以下代码放入 /routes/api/auth 文件夹中的 *auth.ts 文件。

*auth.ts
import { auth } from "~/lib/auth";
import { toSolidStartHandler } from "better-auth/solid-start";

export const { GET, POST } = toSolidStartHandler(auth);

On this page