Spaces:
Paused
Paused
Download agent_zero_framework/python/helpers/login.py from Oldmangrizzz/Agent-Node: direct link, hf CLI and curl.
- Browser
- Download file 388 Bytes
-
https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/helpers/login.py
- Command line
-
hf download hf://spaces/Oldmangrizzz/Agent-Node/agent_zero_framework/python/helpers/login.py
-
curl -L -o login.py https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/helpers/login.py
388 Bytes
| from python.helpers import dotenv | |
| import hashlib | |
| def get_credentials_hash(): | |
| user = dotenv.get_dotenv_value("AUTH_LOGIN") | |
| password = dotenv.get_dotenv_value("AUTH_PASSWORD") | |
| if not user: | |
| return None | |
| return hashlib.sha256(f"{user}:{password}".encode()).hexdigest() | |
| def is_login_required(): | |
| user = dotenv.get_dotenv_value("AUTH_LOGIN") | |
| return bool(user) | |