Spaces:
Sleeping
Sleeping
Download src/libs/shared/presentation/http/middleware/security/PlanGuardMiddleware.ts from fouadkhalid123/asd: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/presentation/http/middleware/security/PlanGuardMiddleware.ts
- Command line
-
hf download hf://spaces/fouadkhalid123/asd/src/libs/shared/presentation/http/middleware/security/PlanGuardMiddleware.ts
-
curl -L -o PlanGuardMiddleware.ts https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/presentation/http/middleware/security/PlanGuardMiddleware.ts
457 Bytes
| import { Request, Response, NextFunction } from "express"; | |
| import { PlanUpgradeError } from "../../../../domain/errors/PlanUpgradeError"; | |
| export const PlanGuardMiddleware = (requiredPlan: string) => { | |
| return (req: Request, res: Response, next: NextFunction) => { | |
| // const plan = req.tenantContext?.plan; | |
| // if (!plan || plan !== requiredPlan) { | |
| // return next(new PlanUpgradeError()); | |
| // } | |
| next(); | |
| }; | |
| }; | |