Spaces:
Running
Running
File size: 303 Bytes
ea6c2a8 94b66c3 ea6c2a8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
export default async function checkUser(req, res, next) {
if (process.env.HF_TOKEN && process.env.HF_TOKEN !== "") {
return next();
}
const { hf_token } = req.cookies;
if (!hf_token) {
return res.status(401).send({
ok: false,
message: "Unauthorized",
});
}
next();
}
|