INNER CODE UNIT · Python
get_auth_token
MakazhanAlpamys/Soup · src/soup_cli/ui/app.py:294
def get_auth_token() -> str:
"""Return the current auth token (for printing at startup)."""
with _auth_token_lock:
return _auth_token
def set_auth_token(token: str) -> None:
"""Replace the process-wide auth token (used by `soup ui --auth-token`).
Validates via `utils.qr_url.validate_token` so a malformed override
can't bypass the urlsafe-base64 shape check.
"""
from soup_cli.utils.qr_url import validate_token
validated = validate_token(token)
global _auth_token
with _auth_token_lock:
_auth_token = validated