import {NextFunction, Request, Response} from "express";
import {AppError} from "../../core/AppError";

export const requirePos = (
    req: Request,
    _res: Response,
    next: NextFunction
) => {
    if (!req.auth || req.auth.type !== "pos") {
        throw new AppError("Forbidden", 403)
    }

    next()
}