Loading...
Loading...
Compare original and translation side by side
auth.tsauth-client.tscreateAuthClient"use client"signIn.magicLinkgetSession.tsauth.tsauth-client.tscreateAuthClient"use client"signIn.magicLinkgetSession.tsauth.tsauth.tsauth.tsdrizzleAdaptersrc/shared/infrastructure/postgres/schema.tsdrizzle-postgres/advanced: {
generateId: false, // Let Postgres/Drizzle default generate the UUIDv7
}
// or if strictly handled within the library:
advanced: {
database: {
generateId: "uuid", // Assuming standard UUID mapping
}
}GOOGLE_CLIENT_IDRESEND_API_KEYsrc/shared/infrastructure/load-env.tsprocess.envmagicLinkemailOTPauth.tsdrizzleAdaptersrc/shared/infrastructure/postgres/schema.tsdrizzle-postgres/advanced: {
generateId: false, // 让Postgres/Drizzle默认生成UUIDv7
}
// 或者如果严格在库内处理:
advanced: {
database: {
generateId: "uuid", // 假设使用标准UUID映射
}
}GOOGLE_CLIENT_IDRESEND_API_KEYsrc/shared/infrastructure/load-env.tsprocess.envmagicLinkemailOTPreact-emailreact-emailmagicLinkemailOTPresendauth.ts@react-email/components<Html><Head><Button>magicLinkemailOTPresendauth.ts@react-email/components<Html><Head><Button>https://better-auth.com/docs/authentication/googleGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET.envsrc/shared/infrastructure/load-env.tshttps://better-auth.com/docs/authentication/googleGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET.envsrc/shared/infrastructure/load-env.tsimport { auth } from "@/auth/auth";
import { headers } from "next/headers";
// Inside the server action
const session = await auth.api.getSession({ headers: await headers() });
if (!session) {
return { success: false, error: "UNAUTHORIZED" };
}import { auth } from "@/auth/auth";
import { headers } from "next/headers";
// 在服务端动作内部
const session = await auth.api.getSession({ headers: await headers() });
if (!session) {
return { success: false, error: "UNAUTHORIZED" };
}import { auth } from "@/auth/auth";
import { headers } from "next/headers";
const session = await auth.api.getSession({ headers: await headers() });import { auth } from "@/auth/auth";
import { headers } from "next/headers";
const session = await auth.api.getSession({ headers: await headers() });auth-client.tsuseSession()auth-client.tsuseSession()Better AuthParamsauth.api.getSession()session.user.idserviceContainer.module.useCase.execute({ userId: session.user.id, ...params })Better AuthParamsauth.api.getSession()session.user.idserviceContainer.module.useCase.execute({ userId: session.user.id, ...params })drizzleAdaptermagicLinkemailOTPdrizzleAdaptermagicLinkemailOTP