Spaces:
Paused
Paused
Download middlewares/checkUser.js from bagihosting/Bagi-Coding: direct link, hf CLI and curl.
- Browser
- Download file 219 Bytes
-
https://huggingface.co/spaces/bagihosting/Bagi-Coding/resolve/main/middlewares/checkUser.js
- Command line
-
hf download hf://spaces/bagihosting/Bagi-Coding/middlewares/checkUser.js
-
curl -L -o checkUser.js https://huggingface.co/spaces/bagihosting/Bagi-Coding/resolve/main/middlewares/checkUser.js
219 Bytes
| export default async function checkUser(req, res, next) { | |
| const { hf_token } = req.cookies; | |
| if (!hf_token) { | |
| return res.status(401).send({ | |
| ok: false, | |
| message: "Unauthorized", | |
| }); | |
| } | |
| next(); | |
| } | |