mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-16 11:24:45 +08:00
chore: create frontend project from boilerplate
This commit is contained in:
5
frontend/src/server/better-auth/client.ts
Normal file
5
frontend/src/server/better-auth/client.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createAuthClient } from "better-auth/react";
|
||||
|
||||
export const authClient = createAuthClient();
|
||||
|
||||
export type Session = typeof authClient.$Infer.Session;
|
||||
9
frontend/src/server/better-auth/config.ts
Normal file
9
frontend/src/server/better-auth/config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { betterAuth } from "better-auth";
|
||||
|
||||
export const auth = betterAuth({
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
export type Session = typeof auth.$Infer.Session;
|
||||
1
frontend/src/server/better-auth/index.ts
Normal file
1
frontend/src/server/better-auth/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { auth } from "./config";
|
||||
7
frontend/src/server/better-auth/server.ts
Normal file
7
frontend/src/server/better-auth/server.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { auth } from ".";
|
||||
import { headers } from "next/headers";
|
||||
import { cache } from "react";
|
||||
|
||||
export const getSession = cache(async () =>
|
||||
auth.api.getSession({ headers: await headers() }),
|
||||
);
|
||||
Reference in New Issue
Block a user