Move middlewares to dedicated folder with one per file
- Create src/middlewares/ folder with separate files: - os.ts: base implementer - auth.ts: authentication middleware - login-request.ts: login request middleware - superuser.ts: chains authMiddleware then checks superuser - Update base.ts to re-export from middlewares - Update admin procedures to use merged superuserMiddleware (no longer need to chain authMiddleware.use(superuserMiddleware)) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
10
apps/api-server/src/middlewares/os.ts
Normal file
10
apps/api-server/src/middlewares/os.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Base implementer with typed APIContext
|
||||
* All procedures and middlewares should derive from this
|
||||
*/
|
||||
|
||||
import type { APIContext } from "../context.js";
|
||||
import { implement } from "@orpc/server";
|
||||
import { contract } from "@reviq/api-contract";
|
||||
|
||||
export const os = implement(contract).$context<APIContext>();
|
||||
Reference in New Issue
Block a user