initial commit
This commit is contained in:
11
apps/web/src/middleware/auth.ts
Normal file
11
apps/web/src/middleware/auth.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { createMiddleware } from "@tanstack/react-start";
|
||||
import { auth } from "@zendegi/auth";
|
||||
|
||||
export const authMiddleware = createMiddleware().server(async ({ next, request }) => {
|
||||
const session = await auth.api.getSession({
|
||||
headers: request.headers,
|
||||
});
|
||||
return next({
|
||||
context: { session },
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user