Spaces:
Sleeping
Sleeping
Download python_backend/api/middlewares/verifyuser_middleware.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/api/middlewares/verifyuser_middleware.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/api/middlewares/verifyuser_middleware.py
-
curl -L -o verifyuser_middleware.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/api/middlewares/verifyuser_middleware.py
426 Bytes
| from fastapi import Request,HTTPException,status | |
| async def verify_jwt(request: Request): | |
| print(request) | |
| # token = request.headers.get("Authorization") | |
| # if not token or token != "Bearer my_secret_token": | |
| # raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, | |
| # detail="Invalid or missing JWT token") | |
| # return True # ya user info return kar sakte ho | |
| return True |