documaticai / auth.py
rockerritesh's picture
new-auth
0596440 verified
raw
history blame contribute delete
289 Bytes
from typing import Optional
def isAuthorized(authorization: Optional[str], TOKEN: str) -> bool:
if authorization is None:
return False
if not authorization.startswith("Token "):
return False
token = authorization.split(" ")[1]
return token == TOKEN