Initial commit

This commit is contained in:
2026-11-05 08:28:15 +00:00
commit 08582a4f70
65 changed files with 1886 additions and 0 deletions
@@ -0,0 +1,19 @@
import jwt
from fastapi import Header, status, HTTPException
from backend.code.services.token import TokenService
class PrivateMiddleware:
def __init__(self):
self._tokenService = TokenService()
def HasToken(self, token: str = Header(...)):
if token is None:
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED)
if self._tokenService.ValidateToken(token) == False:
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED)
return token