initial commit
This commit is contained in:
9
apps/web/src/functions/get-user.ts
Normal file
9
apps/web/src/functions/get-user.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createServerFn } from "@tanstack/react-start";
|
||||
|
||||
import { authMiddleware } from "@/middleware/auth";
|
||||
|
||||
export const getUser = createServerFn({ method: "GET" })
|
||||
.middleware([authMiddleware])
|
||||
.handler(async ({ context }) => {
|
||||
return context.session;
|
||||
});
|
||||
Reference in New Issue
Block a user