最近版本(0.26.100)包含一个很不错的特性支持在checkAuth进行自定义异常以及状态码的返回处理
const {CubejsHandlerError} = require("@cubejs-backend/api-gateway")
module.exports = {
checkAuth: (req, auth) => {
throw new CubejsHandlerError(401,"auth error","not auth")
},
};
https://github.com/cube-js/cube.js/releases/tag/v0.26.100
原文:https://www.cnblogs.com/rongfengliang/p/14682602.html