MCPcopy Create free account
hub / github.com/Clarifai/clarifai-python / login

Function login

scripts/key_for_tests.py:48–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46
47
48def login():
49 url = "/login"
50 payload = {"email": EMAIL, "password": PASSWORD}
51 data = _request(method="POST", url=url, payload=payload)
52 _assert_response_success(data)
53
54 assert "v2_user_id" in data, f"Invalid response {data}"
55 user_id = data["v2_user_id"]
56 assert user_id, f"Invalid response {data}"
57
58 assert "session_token" in data, f"Invalid response {data}"
59 session_token = data["session_token"]
60 assert session_token, f"Invalid response {data}"
61
62 return session_token, user_id
63
64
65def _auth_headers(session_token):

Callers 2

create_patFunction · 0.70
runFunction · 0.70

Calls 2

_requestFunction · 0.85
_assert_response_successFunction · 0.85

Tested by

no test coverage detected